aq-fe-framework 0.1.201 → 0.1.203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  baseAxios_default,
3
3
  useQ_AQ_GetAQModule
4
- } from "./chunk-J76K4YUA.mjs";
4
+ } from "./chunk-XBRWDG25.mjs";
5
5
  import {
6
6
  createGenericStore
7
7
  } from "./chunk-Y3YGC5IH.mjs";
@@ -1,28 +1,43 @@
1
- // src/hooks/custom-hooks/useC_MutationAction.tsx
2
- import { useQueryClient } from "@tanstack/react-query";
3
-
4
1
  // src/api/baseAxios.ts
5
2
  import axios from "axios";
6
- var baseAxios = axios.create({
7
- baseURL: process.env.NEXT_PUBLIC_API
8
- });
3
+ var baseAxios = axios.create();
9
4
  baseAxios.interceptors.request.use(
10
5
  (config) => {
11
6
  var _a, _b;
12
7
  const tokenData = localStorage.getItem("useS_authenticate");
13
- const state = JSON.parse(tokenData);
8
+ const state = tokenData ? JSON.parse(tokenData) : null;
14
9
  const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
15
10
  if (token) {
16
11
  config.headers.Authorization = `Bearer ${token}`;
17
12
  }
18
13
  return config;
19
14
  },
20
- (error) => {
21
- return Promise.reject(error);
22
- }
15
+ (error) => Promise.reject(error)
23
16
  );
24
17
  var baseAxios_default = baseAxios;
25
18
 
19
+ // src/hooks/useLoadConfig.ts
20
+ import { useEffect } from "react";
21
+ var useLoadConfig = () => {
22
+ useEffect(() => {
23
+ (async () => {
24
+ try {
25
+ const res = await fetch("/config.json");
26
+ const config = await res.json();
27
+ if (config.baseURL) {
28
+ baseAxios_default.defaults.baseURL = config.baseURL;
29
+ console.log("\u2705 baseURL set to", config.baseURL);
30
+ }
31
+ } catch (err) {
32
+ console.error("\u274C L\u1ED7i khi load config.json:", err);
33
+ }
34
+ })();
35
+ }, []);
36
+ };
37
+
38
+ // src/hooks/custom-hooks/useC_MutationAction.tsx
39
+ import { useQueryClient } from "@tanstack/react-query";
40
+
26
41
  // src/hooks/query/AQ/useQ_AQ_GetAQModule.ts
27
42
  import { useQuery } from "@tanstack/react-query";
28
43
  function useQ_AQ_GetAQModule() {
@@ -52,5 +67,6 @@ function useQ_SkillCenter_GetAll() {
52
67
  export {
53
68
  baseAxios_default,
54
69
  useQ_AQ_GetAQModule,
70
+ useLoadConfig,
55
71
  useQ_SkillCenter_GetAll
56
72
  };
@@ -66,8 +66,8 @@ import {
66
66
  useS_BasicAppShell,
67
67
  useS_ButtonImport,
68
68
  utils_layout_getItemsWithoutLinks
69
- } from "../chunk-BQSJZ3WA.mjs";
70
- import "../chunk-J76K4YUA.mjs";
69
+ } from "../chunk-RZDOLASD.mjs";
70
+ import "../chunk-XBRWDG25.mjs";
71
71
  import "../chunk-Y3YGC5IH.mjs";
72
72
  import "../chunk-5U2JSHSJ.mjs";
73
73
  import "../chunk-7ZCOFATU.mjs";
@@ -1,6 +1,8 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { I as IAQModule } from '../IAQModule-XZYlbivW.mjs';
3
3
 
4
+ declare const useLoadConfig: () => void;
5
+
4
6
  declare function useQ_AQ_GetAQModule(): _tanstack_react_query.UseQueryResult<IAQModule, Error>;
5
7
 
6
- export { useQ_AQ_GetAQModule };
8
+ export { useLoadConfig, useQ_AQ_GetAQModule };
@@ -1,8 +1,10 @@
1
1
  import {
2
+ useLoadConfig,
2
3
  useQ_AQ_GetAQModule
3
- } from "../chunk-J76K4YUA.mjs";
4
+ } from "../chunk-XBRWDG25.mjs";
4
5
  import "../chunk-7ZCOFATU.mjs";
5
6
  import "../chunk-FWCSY2DS.mjs";
6
7
  export {
8
+ useLoadConfig,
7
9
  useQ_AQ_GetAQModule
8
10
  };
@@ -25,12 +25,12 @@ import {
25
25
  useS_BasicAppShell,
26
26
  useS_authenticate,
27
27
  utils_layout_getItemsWithoutLinks
28
- } from "../chunk-BQSJZ3WA.mjs";
28
+ } from "../chunk-RZDOLASD.mjs";
29
29
  import {
30
30
  baseAxios_default,
31
31
  useQ_AQ_GetAQModule,
32
32
  useQ_SkillCenter_GetAll
33
- } from "../chunk-J76K4YUA.mjs";
33
+ } from "../chunk-XBRWDG25.mjs";
34
34
  import {
35
35
  createGenericStore
36
36
  } from "../chunk-Y3YGC5IH.mjs";
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "types": "./dist/hooks/index.d.mts"
23
23
  }
24
24
  },
25
- "version": "0.1.201",
25
+ "version": "0.1.203",
26
26
  "private": false,
27
27
  "files": [
28
28
  "dist"
@@ -76,6 +76,7 @@
76
76
  "@tiptap/starter-kit": "^2.9.1",
77
77
  "autoprefixer": "^10.4.20",
78
78
  "axios": "^1.7.7",
79
+ "caniuse-lite": "^1.0.30001718",
79
80
  "clsx": "^2.1.1",
80
81
  "dayjs": "^1.11.13",
81
82
  "docxtemplater": "^3.54.1",