aq-fe-framework 0.1.494 → 0.1.496
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-KFSAV44B.mjs → chunk-5IELATPH.mjs} +17 -7
- package/dist/{chunk-M7LQN7UK.mjs → chunk-K2DC3T55.mjs} +2 -2
- package/dist/{chunk-ZXZZLBG3.mjs → chunk-YAMXCOJ5.mjs} +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +4 -4
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.mjs +1 -1
- package/dist/modules-features/index.mjs +9 -9
- package/package.json +1 -1
@@ -185,15 +185,25 @@ function useMyReactQuery({
|
|
185
185
|
mockData
|
186
186
|
}) {
|
187
187
|
return useQuery(__spreadValues({
|
188
|
-
queryKey,
|
188
|
+
queryKey: queryKey != null ? queryKey : [],
|
189
|
+
// dùng mảng rỗng để tránh lỗi
|
190
|
+
enabled: !!queryKey,
|
191
|
+
// nếu queryKey undefined thì không chạy query
|
189
192
|
queryFn: async () => {
|
190
|
-
const
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
193
|
+
const isPrototype = process.env.NEXT_PUBLIC_APP_PROTOTYPE === "1";
|
194
|
+
if (isPrototype) {
|
195
|
+
if (mockData !== void 0) {
|
196
|
+
return mockData;
|
197
|
+
}
|
198
|
+
throw new Error("Prototype mode is on but no mockData provided.");
|
199
|
+
}
|
200
|
+
if (!axiosFn) {
|
201
|
+
throw new Error("axiosFn is required when not in prototype mode.");
|
202
|
+
}
|
195
203
|
const res = await axiosFn();
|
196
|
-
if (res.data.isSuccess
|
204
|
+
if (res.data.isSuccess === 0) {
|
205
|
+
throw new Error(res.data.message || "API returned isSuccess = 0");
|
206
|
+
}
|
197
207
|
return res.data.data;
|
198
208
|
}
|
199
209
|
}, options));
|
@@ -2,7 +2,7 @@ import {
|
|
2
2
|
MyDataTable,
|
3
3
|
MyFlexColumn,
|
4
4
|
MyFlexRow
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-YAMXCOJ5.mjs";
|
6
6
|
import {
|
7
7
|
const_object_colors
|
8
8
|
} from "./chunk-OMJJAHOC.mjs";
|
@@ -12,7 +12,7 @@ import {
|
|
12
12
|
import {
|
13
13
|
useMyReactMutation,
|
14
14
|
useMyReactQuery
|
15
|
-
} from "./chunk-
|
15
|
+
} from "./chunk-5IELATPH.mjs";
|
16
16
|
import {
|
17
17
|
utils_notification_show
|
18
18
|
} from "./chunk-7ZCOFATU.mjs";
|
@@ -66,11 +66,11 @@ import {
|
|
66
66
|
useS_BasicAppShell,
|
67
67
|
useS_ButtonImport,
|
68
68
|
utils_layout_getItemsWithoutLinks
|
69
|
-
} from "../chunk-
|
69
|
+
} from "../chunk-YAMXCOJ5.mjs";
|
70
70
|
import "../chunk-U62R2QKJ.mjs";
|
71
71
|
import "../chunk-5U2JSHSJ.mjs";
|
72
72
|
import "../chunk-OMJJAHOC.mjs";
|
73
|
-
import "../chunk-
|
73
|
+
import "../chunk-5IELATPH.mjs";
|
74
74
|
import "../chunk-7ZCOFATU.mjs";
|
75
75
|
import "../chunk-FWCSY2DS.mjs";
|
76
76
|
export {
|
package/dist/core/index.d.mts
CHANGED
@@ -150,8 +150,8 @@ interface MySelectProps extends SelectProps {
|
|
150
150
|
declare function MySelect({ label, data, isLoading, isError, ...rest }: MySelectProps): react_jsx_runtime.JSX.Element;
|
151
151
|
|
152
152
|
interface MySelectFromAPIProps<IRes extends IBaseEntity, IBody = any> extends MySelectProps {
|
153
|
-
queryKey
|
154
|
-
axiosFn
|
153
|
+
queryKey?: QueryKey;
|
154
|
+
axiosFn?: () => Promise<AxiosResponse<MyApiResponse<IRes[]>, IBody>>;
|
155
155
|
labelWithCode?: boolean;
|
156
156
|
queryOptions?: Partial<UseQueryOptions<IRes[], Error>>;
|
157
157
|
getOptionLabel?: (item: IRes) => string;
|
package/dist/core/index.mjs
CHANGED
@@ -18,14 +18,14 @@ import {
|
|
18
18
|
MyStatsCard,
|
19
19
|
MyTextInput,
|
20
20
|
MyWeeklySessionSchedulerPicker
|
21
|
-
} from "../chunk-
|
22
|
-
import "../chunk-
|
23
|
-
import "../chunk-ZXZZLBG3.mjs";
|
21
|
+
} from "../chunk-K2DC3T55.mjs";
|
22
|
+
import "../chunk-YAMXCOJ5.mjs";
|
24
23
|
import "../chunk-U62R2QKJ.mjs";
|
25
24
|
import "../chunk-5U2JSHSJ.mjs";
|
25
|
+
import "../chunk-GFEMKKFH.mjs";
|
26
26
|
import "../chunk-OMJJAHOC.mjs";
|
27
27
|
import "../chunk-K6S7R6LU.mjs";
|
28
|
-
import "../chunk-
|
28
|
+
import "../chunk-5IELATPH.mjs";
|
29
29
|
import "../chunk-7ZCOFATU.mjs";
|
30
30
|
import "../chunk-FWCSY2DS.mjs";
|
31
31
|
export {
|
package/dist/hooks/index.d.mts
CHANGED
@@ -50,12 +50,12 @@ interface MyReactMutationProps<IReq, IRes> {
|
|
50
50
|
declare function useMyReactMutation<IReq, IRes>({ axiosFn, options, }: MyReactMutationProps<IReq, IRes>): _tanstack_react_query.UseMutationResult<IRes, Error, IReq, unknown>;
|
51
51
|
|
52
52
|
interface MyReactQueryProps<IRes, IBody> {
|
53
|
-
queryKey
|
54
|
-
axiosFn
|
53
|
+
queryKey?: QueryKey;
|
54
|
+
axiosFn?: () => Promise<AxiosResponse<MyApiResponse<IRes>, IBody>>;
|
55
55
|
options?: Partial<UseQueryOptions<IRes, Error>>;
|
56
56
|
mockData?: IRes;
|
57
57
|
}
|
58
|
-
declare function useMyReactQuery<IRes, IBody>({ queryKey, axiosFn, options, mockData }: MyReactQueryProps<IRes, IBody>): _tanstack_react_query.UseQueryResult<IRes, Error>;
|
58
|
+
declare function useMyReactQuery<IRes, IBody>({ queryKey, axiosFn, options, mockData, }: MyReactQueryProps<IRes, IBody>): _tanstack_react_query.UseQueryResult<IRes, Error>;
|
59
59
|
|
60
60
|
declare function useQ_AQ_GetAQModule(): _tanstack_react_query.UseQueryResult<IAQModule, Error>;
|
61
61
|
|
package/dist/hooks/index.mjs
CHANGED
@@ -5,9 +5,6 @@ import {
|
|
5
5
|
utils_converter_enumToSelectOptions,
|
6
6
|
utils_file_fileToAQDocumentType
|
7
7
|
} from "../chunk-TSVSOCNO.mjs";
|
8
|
-
import {
|
9
|
-
enum_emailConfigModule
|
10
|
-
} from "../chunk-VH4ZAD6M.mjs";
|
11
8
|
import {
|
12
9
|
baseColumns
|
13
10
|
} from "../chunk-BEFEWY44.mjs";
|
@@ -18,10 +15,7 @@ import {
|
|
18
15
|
MyButton as MyButton2,
|
19
16
|
MyDataTableSelectOne,
|
20
17
|
MyTextInput as MyTextInput2
|
21
|
-
} from "../chunk-
|
22
|
-
import {
|
23
|
-
const_object_documentTypes
|
24
|
-
} from "../chunk-GFEMKKFH.mjs";
|
18
|
+
} from "../chunk-K2DC3T55.mjs";
|
25
19
|
import {
|
26
20
|
F_authenticate_Logout,
|
27
21
|
MyActionIconDelete,
|
@@ -47,14 +41,20 @@ import {
|
|
47
41
|
groupToTwoLevels,
|
48
42
|
useS_authenticate,
|
49
43
|
utils_layout_getItemsWithoutLinks
|
50
|
-
} from "../chunk-
|
44
|
+
} from "../chunk-YAMXCOJ5.mjs";
|
51
45
|
import {
|
52
46
|
createGenericStore
|
53
47
|
} from "../chunk-U62R2QKJ.mjs";
|
54
48
|
import "../chunk-5U2JSHSJ.mjs";
|
49
|
+
import {
|
50
|
+
const_object_documentTypes
|
51
|
+
} from "../chunk-GFEMKKFH.mjs";
|
55
52
|
import {
|
56
53
|
const_object_colors
|
57
54
|
} from "../chunk-OMJJAHOC.mjs";
|
55
|
+
import {
|
56
|
+
enum_emailConfigModule
|
57
|
+
} from "../chunk-VH4ZAD6M.mjs";
|
58
58
|
import "../chunk-K6S7R6LU.mjs";
|
59
59
|
import {
|
60
60
|
baseAxios_default,
|
@@ -65,7 +65,7 @@ import {
|
|
65
65
|
useMyRouter,
|
66
66
|
useQ_AQ_GetAQModule,
|
67
67
|
useQ_SkillCenter_GetAll
|
68
|
-
} from "../chunk-
|
68
|
+
} from "../chunk-5IELATPH.mjs";
|
69
69
|
import {
|
70
70
|
utils_notification_show
|
71
71
|
} from "../chunk-7ZCOFATU.mjs";
|