aq-fe-framework 0.1.205 → 0.1.206
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.
- package/dist/{chunk-CUMGXY5T.mjs → chunk-3ZDIILYJ.mjs} +16 -0
- package/dist/{chunk-DTTVAJG7.mjs → chunk-C4U5O7IJ.mjs} +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/hooks/index.d.mts +9 -2
- package/dist/hooks/index.mjs +3 -1
- package/dist/modules-features/index.mjs +2 -2
- package/package.json +1 -1
@@ -89,6 +89,21 @@ function useMyReactMutation({
|
|
89
89
|
|
90
90
|
// src/hooks/custom-hooks/useMyReactQuery.ts
|
91
91
|
import { useQuery } from "@tanstack/react-query";
|
92
|
+
function useMyReactQuery({
|
93
|
+
queryKey,
|
94
|
+
axiosFn,
|
95
|
+
options
|
96
|
+
}) {
|
97
|
+
return useQuery(__spreadValues({
|
98
|
+
queryKey,
|
99
|
+
// bạn tự thêm queryKey khi dùng nhé
|
100
|
+
queryFn: async () => {
|
101
|
+
const res = await axiosFn();
|
102
|
+
if (res.data.isSuccess == 0) throw new Error(res.data.message);
|
103
|
+
return res.data.data;
|
104
|
+
}
|
105
|
+
}, options));
|
106
|
+
}
|
92
107
|
|
93
108
|
// src/hooks/query/AQ/useQ_AQ_GetAQModule.ts
|
94
109
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
@@ -122,5 +137,6 @@ export {
|
|
122
137
|
useLoadConfig,
|
123
138
|
createBaseApi,
|
124
139
|
useMyReactMutation,
|
140
|
+
useMyReactQuery,
|
125
141
|
useQ_SkillCenter_GetAll
|
126
142
|
};
|
@@ -66,8 +66,8 @@ import {
|
|
66
66
|
useS_BasicAppShell,
|
67
67
|
useS_ButtonImport,
|
68
68
|
utils_layout_getItemsWithoutLinks
|
69
|
-
} from "../chunk-
|
70
|
-
import "../chunk-
|
69
|
+
} from "../chunk-C4U5O7IJ.mjs";
|
70
|
+
import "../chunk-3ZDIILYJ.mjs";
|
71
71
|
import "../chunk-Y3YGC5IH.mjs";
|
72
72
|
import "../chunk-5U2JSHSJ.mjs";
|
73
73
|
import "../chunk-7ZCOFATU.mjs";
|
package/dist/hooks/index.d.mts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as axios from 'axios';
|
2
2
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
4
|
-
import { UseMutationOptions } from '@tanstack/react-query';
|
4
|
+
import { UseMutationOptions, QueryKey, UseQueryOptions } from '@tanstack/react-query';
|
5
5
|
import { I as IAQModule } from '../IAQModule-XZYlbivW.mjs';
|
6
6
|
|
7
7
|
declare const useLoadConfig: () => void;
|
@@ -26,6 +26,13 @@ interface MyReactMutationProps<IReq, IRes> {
|
|
26
26
|
}
|
27
27
|
declare function useMyReactMutation<IReq, IRes>({ axiosFn, options, }: MyReactMutationProps<IReq, IRes>): _tanstack_react_query.UseMutationResult<IRes, Error, IReq, unknown>;
|
28
28
|
|
29
|
+
interface MyReactQueryProps<IRes, IBody> {
|
30
|
+
queryKey: QueryKey;
|
31
|
+
axiosFn: () => Promise<AxiosResponse<MyApiResponse<IRes>, IBody>>;
|
32
|
+
options?: Partial<UseQueryOptions<IRes, Error>>;
|
33
|
+
}
|
34
|
+
declare function useMyReactQuery<IRes, IBody>({ queryKey, axiosFn, options }: MyReactQueryProps<IRes, IBody>): _tanstack_react_query.UseQueryResult<IRes, Error>;
|
35
|
+
|
29
36
|
declare function useQ_AQ_GetAQModule(): _tanstack_react_query.UseQueryResult<IAQModule, Error>;
|
30
37
|
|
31
|
-
export { type MyApiResponse, createBaseApi, useLoadConfig, useMyReactMutation, useQ_AQ_GetAQModule };
|
38
|
+
export { type MyApiResponse, createBaseApi, useLoadConfig, useMyReactMutation, useMyReactQuery, useQ_AQ_GetAQModule };
|
package/dist/hooks/index.mjs
CHANGED
@@ -2,13 +2,15 @@ import {
|
|
2
2
|
createBaseApi,
|
3
3
|
useLoadConfig,
|
4
4
|
useMyReactMutation,
|
5
|
+
useMyReactQuery,
|
5
6
|
useQ_AQ_GetAQModule
|
6
|
-
} from "../chunk-
|
7
|
+
} from "../chunk-3ZDIILYJ.mjs";
|
7
8
|
import "../chunk-7ZCOFATU.mjs";
|
8
9
|
import "../chunk-FWCSY2DS.mjs";
|
9
10
|
export {
|
10
11
|
createBaseApi,
|
11
12
|
useLoadConfig,
|
12
13
|
useMyReactMutation,
|
14
|
+
useMyReactQuery,
|
13
15
|
useQ_AQ_GetAQModule
|
14
16
|
};
|
@@ -25,12 +25,12 @@ import {
|
|
25
25
|
useS_BasicAppShell,
|
26
26
|
useS_authenticate,
|
27
27
|
utils_layout_getItemsWithoutLinks
|
28
|
-
} from "../chunk-
|
28
|
+
} from "../chunk-C4U5O7IJ.mjs";
|
29
29
|
import {
|
30
30
|
baseAxios_default,
|
31
31
|
useQ_AQ_GetAQModule,
|
32
32
|
useQ_SkillCenter_GetAll
|
33
|
-
} from "../chunk-
|
33
|
+
} from "../chunk-3ZDIILYJ.mjs";
|
34
34
|
import {
|
35
35
|
createGenericStore
|
36
36
|
} from "../chunk-Y3YGC5IH.mjs";
|