aq-fe-framework 0.1.226 → 0.1.228

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-D34W6WLY.mjs";
4
+ } from "./chunk-NTUWJLXG.mjs";
5
5
  import {
6
6
  createGenericStore
7
7
  } from "./chunk-Y3YGC5IH.mjs";
@@ -23,12 +23,33 @@ function createBaseApi(baseUrl, axiosInstance) {
23
23
  };
24
24
  }
25
25
 
26
- // src/hooks/custom-hooks/useC_MutationAction.tsx
27
- import { useQueryClient } from "@tanstack/react-query";
26
+ // src/api/config/baseAxios.ts
27
+ import axios from "axios";
28
+ var baseAxios = axios.create({
29
+ baseURL: ""
30
+ // server
31
+ // baseURL: process.env.NEXT_PUBLIC_API_LOCAL, // local debug
32
+ });
33
+ baseAxios.interceptors.request.use(
34
+ (config) => {
35
+ var _a, _b;
36
+ const tokenData = localStorage.getItem("useS_authenticate");
37
+ const state = JSON.parse(tokenData);
38
+ const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
39
+ if (token) {
40
+ config.headers.Authorization = `Bearer ${token}`;
41
+ }
42
+ return config;
43
+ },
44
+ (error) => {
45
+ return Promise.reject(error);
46
+ }
47
+ );
48
+ var baseAxios_default = baseAxios;
28
49
 
29
50
  // src/hooks/custom-hooks/useLoadAxiosConfig.ts
30
51
  import { useEffect } from "react";
31
- var useLoadAxiosConfig = (axiosInstance) => {
52
+ var useLoadAxiosConfig = ({ axiosInstance = baseAxios_default }) => {
32
53
  useEffect(() => {
33
54
  (async () => {
34
55
  try {
@@ -45,6 +66,9 @@ var useLoadAxiosConfig = (axiosInstance) => {
45
66
  }, [axiosInstance]);
46
67
  };
47
68
 
69
+ // src/hooks/custom-hooks/useMutationAction.tsx
70
+ import { useQueryClient } from "@tanstack/react-query";
71
+
48
72
  // src/hooks/custom-hooks/useMyReactMutation.ts
49
73
  import { useMutation } from "@tanstack/react-query";
50
74
  function useMyReactMutation({
@@ -78,30 +102,6 @@ function useMyReactQuery({
78
102
  }, options));
79
103
  }
80
104
 
81
- // src/api/config/baseAxios.ts
82
- import axios from "axios";
83
- var baseAxios = axios.create({
84
- baseURL: ""
85
- // server
86
- // baseURL: process.env.NEXT_PUBLIC_API_LOCAL, // local debug
87
- });
88
- baseAxios.interceptors.request.use(
89
- (config) => {
90
- var _a, _b;
91
- const tokenData = localStorage.getItem("useS_authenticate");
92
- const state = JSON.parse(tokenData);
93
- const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
94
- if (token) {
95
- config.headers.Authorization = `Bearer ${token}`;
96
- }
97
- return config;
98
- },
99
- (error) => {
100
- return Promise.reject(error);
101
- }
102
- );
103
- var baseAxios_default = baseAxios;
104
-
105
105
  // src/hooks/query/AQ/useQ_AQ_GetAQModule.ts
106
106
  import { useQuery as useQuery2 } from "@tanstack/react-query";
107
107
  function useQ_AQ_GetAQModule() {
@@ -65,8 +65,8 @@ import {
65
65
  useS_BasicAppShell,
66
66
  useS_ButtonImport,
67
67
  utils_layout_getItemsWithoutLinks
68
- } from "../chunk-EKVQH4CN.mjs";
69
- import "../chunk-D34W6WLY.mjs";
68
+ } from "../chunk-7KRHJHRV.mjs";
69
+ import "../chunk-NTUWJLXG.mjs";
70
70
  import "../chunk-Y3YGC5IH.mjs";
71
71
  import "../chunk-5U2JSHSJ.mjs";
72
72
  import "../chunk-7ZCOFATU.mjs";
@@ -19,7 +19,9 @@ declare function createBaseApi<T>(baseUrl: string, axiosInstance: AxiosInstance)
19
19
  delete: (id: number) => Promise<axios.AxiosResponse<any, any>>;
20
20
  };
21
21
 
22
- declare const useLoadAxiosConfig: (axiosInstance: AxiosInstance) => void;
22
+ declare const useLoadAxiosConfig: ({ axiosInstance }: {
23
+ axiosInstance?: AxiosInstance;
24
+ }) => void;
23
25
 
24
26
  interface MyReactMutationProps<IReq, IRes> {
25
27
  axiosFn: (variables: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>>;
@@ -4,7 +4,7 @@ import {
4
4
  useMyReactMutation,
5
5
  useMyReactQuery,
6
6
  useQ_AQ_GetAQModule
7
- } from "../chunk-D34W6WLY.mjs";
7
+ } from "../chunk-NTUWJLXG.mjs";
8
8
  import "../chunk-7ZCOFATU.mjs";
9
9
  import "../chunk-FWCSY2DS.mjs";
10
10
  export {
@@ -25,12 +25,12 @@ import {
25
25
  useS_BasicAppShell,
26
26
  useS_authenticate,
27
27
  utils_layout_getItemsWithoutLinks
28
- } from "../chunk-EKVQH4CN.mjs";
28
+ } from "../chunk-7KRHJHRV.mjs";
29
29
  import {
30
30
  baseAxios_default,
31
31
  useQ_AQ_GetAQModule,
32
32
  useQ_SkillCenter_GetAll
33
- } from "../chunk-D34W6WLY.mjs";
33
+ } from "../chunk-NTUWJLXG.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.226",
25
+ "version": "0.1.228",
26
26
  "private": false,
27
27
  "files": [
28
28
  "dist"