aq-fe-framework 0.1.511 → 0.1.513

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.
@@ -2,7 +2,7 @@ import {
2
2
  MyDataTable,
3
3
  MyFlexColumn,
4
4
  MyFlexRow
5
- } from "./chunk-JYZUJKAM.mjs";
5
+ } from "./chunk-NQMVDLMU.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-5IELATPH.mjs";
15
+ } from "./chunk-LAVGCZ5I.mjs";
16
16
  import {
17
17
  utils_notification_show
18
18
  } from "./chunk-7ZCOFATU.mjs";
@@ -147,19 +147,36 @@ var useLoadAxiosConfig = ({
147
147
  // src/hooks/custom-hooks/useMutationAction.tsx
148
148
  import { useQueryClient } from "@tanstack/react-query";
149
149
 
150
+ // src/types/type_mutation.ts
151
+ var typeLabel_mutation = {
152
+ create: "T\u1EA1o th\xE0nh c\xF4ng!",
153
+ update: "C\u1EADp nh\u1EADt th\xE0nh c\xF4ng!",
154
+ delete: "X\xF3a th\xE0nh c\xF4ng!",
155
+ mutation: "Thao t\xE1c th\xE0nh c\xF4ng!"
156
+ };
157
+
150
158
  // src/hooks/custom-hooks/useMyReactMutation.ts
151
159
  import { notifications } from "@mantine/notifications";
152
- import { useMutation } from "@tanstack/react-query";
160
+ import { useMutation, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
153
161
  function useMyReactMutation({
154
162
  axiosFn,
155
- options
163
+ options,
164
+ mutationType = "create"
156
165
  }) {
166
+ const queryClient = useQueryClient2();
157
167
  return useMutation(__spreadValues({
158
168
  mutationFn: async (values) => {
159
169
  const res = await axiosFn(values);
160
170
  if (res.data.isSuccess == 0) throw new Error(res.data.message);
161
171
  return res.data.data;
162
172
  },
173
+ onSuccess: () => {
174
+ notifications.show({
175
+ message: typeLabel_mutation[mutationType],
176
+ color: "green"
177
+ });
178
+ queryClient.invalidateQueries();
179
+ },
163
180
  onError: (e) => {
164
181
  if (e.message === null || e.message === "null") {
165
182
  notifications.show({
@@ -11,7 +11,7 @@ import {
11
11
  baseAxios_default,
12
12
  useMyReactMutation,
13
13
  useQ_AQ_GetAQModule
14
- } from "./chunk-5IELATPH.mjs";
14
+ } from "./chunk-LAVGCZ5I.mjs";
15
15
  import {
16
16
  utils_notification_show
17
17
  } from "./chunk-7ZCOFATU.mjs";
@@ -67,11 +67,11 @@ import {
67
67
  useS_BasicAppShell,
68
68
  useS_ButtonImport,
69
69
  utils_layout_getItemsWithoutLinks
70
- } from "../chunk-JYZUJKAM.mjs";
70
+ } from "../chunk-NQMVDLMU.mjs";
71
71
  import "../chunk-U62R2QKJ.mjs";
72
72
  import "../chunk-5U2JSHSJ.mjs";
73
73
  import "../chunk-OMJJAHOC.mjs";
74
- import "../chunk-5IELATPH.mjs";
74
+ import "../chunk-LAVGCZ5I.mjs";
75
75
  import "../chunk-7ZCOFATU.mjs";
76
76
  import "../chunk-FWCSY2DS.mjs";
77
77
  export {
@@ -18,14 +18,14 @@ import {
18
18
  MyStatsCard,
19
19
  MyTextInput,
20
20
  MyWeeklySessionSchedulerPicker
21
- } from "../chunk-TXRNH2ZM.mjs";
22
- import "../chunk-JYZUJKAM.mjs";
21
+ } from "../chunk-IIRXBT7L.mjs";
22
+ import "../chunk-GFEMKKFH.mjs";
23
+ import "../chunk-NQMVDLMU.mjs";
23
24
  import "../chunk-U62R2QKJ.mjs";
24
25
  import "../chunk-5U2JSHSJ.mjs";
25
- import "../chunk-GFEMKKFH.mjs";
26
26
  import "../chunk-OMJJAHOC.mjs";
27
27
  import "../chunk-K6S7R6LU.mjs";
28
- import "../chunk-5IELATPH.mjs";
28
+ import "../chunk-LAVGCZ5I.mjs";
29
29
  import "../chunk-7ZCOFATU.mjs";
30
30
  import "../chunk-FWCSY2DS.mjs";
31
31
  export {
@@ -22,4 +22,11 @@ declare enum enum_gender {
22
22
  }
23
23
  declare const enumLabel_gender: Record<enum_gender, string>;
24
24
 
25
- export { enumLabel_gender, enum_daysOfWeek, enum_emailConfigModule, enum_gender };
25
+ declare enum enum_mutationType {
26
+ Create = "create",
27
+ Update = "update",
28
+ Delete = "delete"
29
+ }
30
+ declare const enumLabel_mutationTypeNotification: Record<enum_mutationType, string>;
31
+
32
+ export { enumLabel_gender, enumLabel_mutationTypeNotification, enum_daysOfWeek, enum_emailConfigModule, enum_gender, enum_mutationType };
@@ -18,9 +18,24 @@ var enumLabel_gender = {
18
18
  [2 /* Female */]: "N\u1EEF",
19
19
  [3 /* Other */]: "Kh\xE1c"
20
20
  };
21
+
22
+ // src/enum/enum_mutationType.ts
23
+ var enum_mutationType = /* @__PURE__ */ ((enum_mutationType2) => {
24
+ enum_mutationType2["Create"] = "create";
25
+ enum_mutationType2["Update"] = "update";
26
+ enum_mutationType2["Delete"] = "delete";
27
+ return enum_mutationType2;
28
+ })(enum_mutationType || {});
29
+ var enumLabel_mutationTypeNotification = {
30
+ ["create" /* Create */]: "T\u1EA1o m\u1EDBi th\xE0nh c\xF4ng!",
31
+ ["update" /* Update */]: "C\u1EADp nh\u1EADt th\xE0nh c\xF4ng!",
32
+ ["delete" /* Delete */]: "Xo\xE1 th\xE0nh c\xF4ng!"
33
+ };
21
34
  export {
22
35
  enumLabel_gender,
36
+ enumLabel_mutationTypeNotification,
23
37
  enum_daysOfWeek,
24
38
  enum_emailConfigModule,
25
- enum_gender
39
+ enum_gender,
40
+ enum_mutationType
26
41
  };
@@ -43,11 +43,14 @@ declare const useLoadAxiosConfig: ({ axiosInstance, url, }: {
43
43
  setFlag: React.Dispatch<React.SetStateAction<boolean>>;
44
44
  };
45
45
 
46
+ type type_mutation = "create" | "update" | "delete" | "mutation";
47
+
46
48
  interface MyReactMutationProps<IReq, IRes> {
47
49
  axiosFn: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>>;
48
50
  options?: UseMutationOptions<IRes, Error, IReq>;
51
+ mutationType?: type_mutation;
49
52
  }
50
- declare function useMyReactMutation<IReq, IRes>({ axiosFn, options, }: MyReactMutationProps<IReq, IRes>): _tanstack_react_query.UseMutationResult<IRes, Error, IReq, unknown>;
53
+ declare function useMyReactMutation<IReq, IRes>({ axiosFn, options, mutationType }: MyReactMutationProps<IReq, IRes>): _tanstack_react_query.UseMutationResult<IRes, Error, IReq, unknown>;
51
54
 
52
55
  interface MyReactQueryProps<IRes, IBody> {
53
56
  queryKey?: QueryKey;
@@ -7,7 +7,7 @@ import {
7
7
  useMyReactQuery,
8
8
  useMyRouter,
9
9
  useQ_AQ_GetAQModule
10
- } from "../chunk-5IELATPH.mjs";
10
+ } from "../chunk-LAVGCZ5I.mjs";
11
11
  import "../chunk-7ZCOFATU.mjs";
12
12
  import "../chunk-FWCSY2DS.mjs";
13
13
  export {
@@ -16,7 +16,10 @@ import {
16
16
  MyButton as MyButton2,
17
17
  MyDataTableSelectOne,
18
18
  MyTextInput as MyTextInput2
19
- } from "../chunk-TXRNH2ZM.mjs";
19
+ } from "../chunk-IIRXBT7L.mjs";
20
+ import {
21
+ const_object_documentTypes
22
+ } from "../chunk-GFEMKKFH.mjs";
20
23
  import {
21
24
  F_authenticate_Logout,
22
25
  MyActionIconDelete,
@@ -42,14 +45,11 @@ import {
42
45
  groupToTwoLevels,
43
46
  useS_authenticate,
44
47
  utils_layout_getItemsWithoutLinks
45
- } from "../chunk-JYZUJKAM.mjs";
48
+ } from "../chunk-NQMVDLMU.mjs";
46
49
  import {
47
50
  createGenericStore
48
51
  } from "../chunk-U62R2QKJ.mjs";
49
52
  import "../chunk-5U2JSHSJ.mjs";
50
- import {
51
- const_object_documentTypes
52
- } from "../chunk-GFEMKKFH.mjs";
53
53
  import {
54
54
  const_object_colors
55
55
  } from "../chunk-OMJJAHOC.mjs";
@@ -66,7 +66,7 @@ import {
66
66
  useMyRouter,
67
67
  useQ_AQ_GetAQModule,
68
68
  useQ_SkillCenter_GetAll
69
- } from "../chunk-5IELATPH.mjs";
69
+ } from "../chunk-LAVGCZ5I.mjs";
70
70
  import {
71
71
  utils_notification_show
72
72
  } from "../chunk-7ZCOFATU.mjs";
package/package.json CHANGED
@@ -42,7 +42,7 @@
42
42
  "types": "./dist/columns/index.d.mts"
43
43
  }
44
44
  },
45
- "version": "0.1.511",
45
+ "version": "0.1.513",
46
46
  "private": false,
47
47
  "files": [
48
48
  "dist"