aq-fe-framework 0.1.925 → 0.1.927

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.
@@ -183,6 +183,9 @@ function useConfig({
183
183
  // src/hooks/custom-hooks/useMyReactMutation.ts
184
184
  import { notifications } from "@mantine/notifications";
185
185
  import { useMutation, useQueryClient } from "@tanstack/react-query";
186
+ function isObject(data) {
187
+ return typeof data === "object" && data !== null && !Array.isArray(data);
188
+ }
186
189
  function useMyReactMutation({
187
190
  isPrototype,
188
191
  axiosFn,
@@ -223,11 +226,12 @@ function useMyReactMutation({
223
226
  parsed = null;
224
227
  }
225
228
  if (enableDefaultError) {
226
- notifications.show({
227
- message: (parsed == null ? void 0 : parsed.message) || "Kh\xF4ng th\u1EC3 thao t\xE1c, l\u1ED7i ch\u01B0a x\xE1c \u0111\u1ECBnh!",
228
- color: "red"
229
- });
230
- return;
229
+ if (!isObject(parsed)) {
230
+ notifications.show({
231
+ message: (parsed == null ? void 0 : parsed.message) || "Kh\xF4ng th\u1EC3 thao t\xE1c, l\u1ED7i ch\u01B0a x\xE1c \u0111\u1ECBnh!",
232
+ color: "red"
233
+ });
234
+ }
231
235
  }
232
236
  (_a = options == null ? void 0 : options.onError) == null ? void 0 : _a.call(options, error, variables, context);
233
237
  }
@@ -1,3 +1,7 @@
1
+ import {
2
+ utils_date,
3
+ utils_mantineReactTable
4
+ } from "./chunk-ZDINCHBS.mjs";
1
5
  import {
2
6
  createGenericStore,
3
7
  useAppStore,
@@ -15,10 +19,6 @@ import {
15
19
  utils_file_fileToAQDocumentType,
16
20
  utils_pdf_download
17
21
  } from "./chunk-E4JVWPXS.mjs";
18
- import {
19
- utils_date,
20
- utils_mantineReactTable
21
- } from "./chunk-ZDINCHBS.mjs";
22
22
  import {
23
23
  baseColumns
24
24
  } from "./chunk-O7YCQQO5.mjs";
@@ -42,7 +42,7 @@ import {
42
42
  useMyReactMutation,
43
43
  useMyReactQuery,
44
44
  useQ_AQ_GetAQModule
45
- } from "./chunk-X36ROB3X.mjs";
45
+ } from "./chunk-B7GUGY22.mjs";
46
46
  import {
47
47
  utils_notification_show
48
48
  } from "./chunk-7ZCOFATU.mjs";
@@ -316,6 +316,7 @@ function MyButton(_a) {
316
316
  // src/core/button/MyButtonCreateUpdate.tsx
317
317
  import { Modal, ScrollArea, Space, Tooltip, useMantineColorScheme as useMantineColorScheme3 } from "@mantine/core";
318
318
  import { useDisclosure } from "@mantine/hooks";
319
+ import { notifications } from "@mantine/notifications";
319
320
 
320
321
  // src/core/layout/MyFlexColumn.tsx
321
322
  import { Flex } from "@mantine/core";
@@ -375,6 +376,12 @@ function MyButtonCreateUpdate({
375
376
  Object.entries(parsed.data).forEach(([field, message]) => {
376
377
  form.setFieldError(field.charAt(0).toLowerCase() + field.slice(1), message);
377
378
  });
379
+ const errorMessages = Object.values(parsed.data).join(", ");
380
+ notifications.show({
381
+ title: "Kh\xF4ng th\u1EC3 l\u01B0u d\u1EEF li\u1EC7u",
382
+ message: errorMessages,
383
+ color: "red"
384
+ });
378
385
  return;
379
386
  }
380
387
  }
@@ -13967,7 +13974,7 @@ function EmailTemplateButtonImport({ emailTemplateEnum }) {
13967
13974
  // src/modules-features/admin/core/EmailTemplate/EmailTemplateCreateUpdateButton.tsx
13968
13975
  import { Button as Button19, Grid as Grid6 } from "@mantine/core";
13969
13976
  import { useForm as useForm26 } from "@mantine/form";
13970
- import { notifications } from "@mantine/notifications";
13977
+ import { notifications as notifications2 } from "@mantine/notifications";
13971
13978
  import { useEffect as useEffect27, useMemo as useMemo24 } from "react";
13972
13979
  import { jsx as jsx173, jsxs as jsxs95 } from "react/jsx-runtime";
13973
13980
  var getDefaultBodyFortype1 = () => {
@@ -14075,7 +14082,7 @@ function EmailTemplateCreateUpdateButton({ initValue, emailTemplateEnum }) {
14075
14082
  const typeName = emailTemplateEnum[values.type || 0] || `Type ${values.type}`;
14076
14083
  const errorMessage = `Lo\u1EA1i h\xE0nh \u0111\u1ED9ng "${typeName}" \u0111\xE3 t\u1ED3n t\u1EA1i. Ch\u1EC9 \u0111\u01B0\u1EE3c t\u1EA1o 1 Template trong 1 lo\u1EA1i h\xE0nh \u0111\u1ED9ng.`;
14077
14084
  form.setFieldError("type", errorMessage);
14078
- notifications.show({
14085
+ notifications2.show({
14079
14086
  title: "L\u1ED7i t\u1EA1o template",
14080
14087
  message: errorMessage,
14081
14088
  color: "red",
@@ -15662,7 +15669,7 @@ function Feat_PageContentTable({ menuData }) {
15662
15669
 
15663
15670
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_ReadMenu.tsx
15664
15671
  import { Group as Group33 } from "@mantine/core";
15665
- import { notifications as notifications2 } from "@mantine/notifications";
15672
+ import { notifications as notifications3 } from "@mantine/notifications";
15666
15673
  import { useMemo as useMemo33, useState as useState24 } from "react";
15667
15674
 
15668
15675
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_Export.tsx
@@ -15767,7 +15774,7 @@ function F_pageContentConfig_ReadMenu({ menuData }) {
15767
15774
  });
15768
15775
  setEditedDescriptions((prev) => __spreadValues(__spreadValues({}, prev), updated));
15769
15776
  table.resetRowSelection();
15770
- notifications2.show({
15777
+ notifications3.show({
15771
15778
  message: "X\xF3a th\xE0nh c\xF4ng",
15772
15779
  color: "green"
15773
15780
  });
@@ -16215,7 +16222,7 @@ function Adapter_UserTable(_a) {
16215
16222
 
16216
16223
  // src/modules/User/adapter/Adapter_UserAddToRole.tsx
16217
16224
  import { useDisclosure as useDisclosure16 } from "@mantine/hooks";
16218
- import { notifications as notifications3 } from "@mantine/notifications";
16225
+ import { notifications as notifications4 } from "@mantine/notifications";
16219
16226
  import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
16220
16227
  import { useEffect as useEffect35, useState as useState26 } from "react";
16221
16228
  import { jsx as jsx216 } from "react/jsx-runtime";
@@ -16250,7 +16257,7 @@ function Adapter_UserAddToRole({
16250
16257
  onSuccess: () => {
16251
16258
  disc[1].close();
16252
16259
  queryClient.invalidateQueries();
16253
- notifications3.show({
16260
+ notifications4.show({
16254
16261
  message: "C\u1EADp nh\u1EADt th\xE0nh c\xF4ng",
16255
16262
  color: "green"
16256
16263
  });
@@ -17374,7 +17381,7 @@ import {
17374
17381
  Title as Title2
17375
17382
  } from "@mantine/core";
17376
17383
  import { useForm as useForm44 } from "@mantine/form";
17377
- import { notifications as notifications4 } from "@mantine/notifications";
17384
+ import { notifications as notifications5 } from "@mantine/notifications";
17378
17385
  import { useMutation as useMutation4 } from "@tanstack/react-query";
17379
17386
  import Link4 from "next/link.js";
17380
17387
  import { useRouter as useRouter4 } from "next/navigation.js";
@@ -17468,7 +17475,7 @@ function Feat_Authenticate_Login({
17468
17475
  router.replace(redirectUrlAfterLogin);
17469
17476
  },
17470
17477
  onError: (error) => {
17471
- notifications4.show({
17478
+ notifications5.show({
17472
17479
  message: "C\xF3 l\u1ED7i x\u1EA3y ra vui l\xF2ng th\u1EED l\u1EA1i",
17473
17480
  color: "red"
17474
17481
  });
@@ -18309,7 +18316,7 @@ var service_aq = __spreadProps(__spreadValues({}, createBaseApi(CONTROLLER12, ba
18309
18316
  // src/components/Layouts/PageContent/MyPageContent.tsx
18310
18317
  import { Badge as Badge7, Breadcrumbs, Center as Center12, Container as Container3, Divider as Divider6, Flex as Flex10, Group as Group40, Stack as Stack11, Text as Text29, Title as Title4, Tooltip as Tooltip8 } from "@mantine/core";
18311
18318
  import { useClipboard, useDisclosure as useDisclosure20 } from "@mantine/hooks";
18312
- import { notifications as notifications5 } from "@mantine/notifications";
18319
+ import { notifications as notifications6 } from "@mantine/notifications";
18313
18320
  import { IconBrandParsinta } from "@tabler/icons-react";
18314
18321
  import { useEffect as useEffect42 } from "react";
18315
18322
 
@@ -18463,7 +18470,7 @@ function MyPageContent({
18463
18470
  /* @__PURE__ */ jsx251(Breadcrumbs, { style: { cursor: "pointer" }, separatorMargin: "7", onClick: () => {
18464
18471
  var _a2;
18465
18472
  clipboard.copy((_a2 = basicAppShellStore.state.breadcrumb) == null ? void 0 : _a2.join(" / "));
18466
- notifications5.show({
18473
+ notifications6.show({
18467
18474
  message: "Sao ch\xE9p \u0111\u01B0\u1EDDng d\u1EABn menu th\xE0nh c\xF4ng"
18468
18475
  });
18469
18476
  }, children: (_a = basicAppShellStore.state.breadcrumb) == null ? void 0 : _a.map((item, idx) => /* @__PURE__ */ jsx251(Text29, { fw: "600", c: "blue", children: item }, idx)) })
@@ -18625,7 +18632,7 @@ import {
18625
18632
  Stack as Stack12,
18626
18633
  Text as Text30
18627
18634
  } from "@mantine/core";
18628
- import { notifications as notifications6 } from "@mantine/notifications";
18635
+ import { notifications as notifications7 } from "@mantine/notifications";
18629
18636
  import { IconCircleFilled } from "@tabler/icons-react";
18630
18637
  import { useEffect as useEffect43, useMemo as useMemo42, useState as useState32 } from "react";
18631
18638
  import * as XLSX4 from "xlsx";
@@ -18832,7 +18839,7 @@ function FileImportConfigModal(_a) {
18832
18839
  return;
18833
18840
  }
18834
18841
  if (dataStartIndex == "" || dataStartIndex == null) {
18835
- notifications6.show({
18842
+ notifications7.show({
18836
18843
  message: "D\xF2ng d\u1EEF li\u1EC7u b\u1EAFt \u0111\u1EA7u kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
18837
18844
  color: "red"
18838
18845
  });
@@ -70,15 +70,15 @@ import {
70
70
  useHeaderMegaMenuStore,
71
71
  useS_ButtonImport,
72
72
  useStore_BasicAppShell
73
- } from "../chunk-UJXRBUI3.mjs";
73
+ } from "../chunk-J2ECF7CA.mjs";
74
+ import "../chunk-ZDINCHBS.mjs";
74
75
  import "../chunk-QWHUDAPC.mjs";
75
76
  import "../chunk-E4JVWPXS.mjs";
76
- import "../chunk-ZDINCHBS.mjs";
77
77
  import "../chunk-O7YCQQO5.mjs";
78
78
  import "../chunk-QSWIVDXC.mjs";
79
79
  import "../chunk-SPG47QW7.mjs";
80
80
  import "../chunk-K6S7R6LU.mjs";
81
- import "../chunk-X36ROB3X.mjs";
81
+ import "../chunk-B7GUGY22.mjs";
82
82
  import "../chunk-WZ6PXGGC.mjs";
83
83
  import "../chunk-7ZCOFATU.mjs";
84
84
  import "../chunk-JD6AELXS.mjs";
@@ -31,15 +31,15 @@ import {
31
31
  MyStatsCard,
32
32
  MyTextInput2 as MyTextInput,
33
33
  MyWeeklySessionSchedulerPicker
34
- } from "../chunk-UJXRBUI3.mjs";
34
+ } from "../chunk-J2ECF7CA.mjs";
35
+ import "../chunk-ZDINCHBS.mjs";
35
36
  import "../chunk-QWHUDAPC.mjs";
36
37
  import "../chunk-E4JVWPXS.mjs";
37
- import "../chunk-ZDINCHBS.mjs";
38
38
  import "../chunk-O7YCQQO5.mjs";
39
39
  import "../chunk-QSWIVDXC.mjs";
40
40
  import "../chunk-SPG47QW7.mjs";
41
41
  import "../chunk-K6S7R6LU.mjs";
42
- import "../chunk-X36ROB3X.mjs";
42
+ import "../chunk-B7GUGY22.mjs";
43
43
  import "../chunk-WZ6PXGGC.mjs";
44
44
  import "../chunk-7ZCOFATU.mjs";
45
45
  import "../chunk-JD6AELXS.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  useMyReactQuery,
11
11
  useMyRouter,
12
12
  useQ_AQ_GetAQModule
13
- } from "../chunk-X36ROB3X.mjs";
13
+ } from "../chunk-B7GUGY22.mjs";
14
14
  import "../chunk-WZ6PXGGC.mjs";
15
15
  import "../chunk-7ZCOFATU.mjs";
16
16
  import "../chunk-JD6AELXS.mjs";
@@ -113,15 +113,15 @@ import {
113
113
  MailTemplateDeleteButton,
114
114
  useS_moduleConfig,
115
115
  useStore_Authenticate
116
- } from "../chunk-UJXRBUI3.mjs";
116
+ } from "../chunk-J2ECF7CA.mjs";
117
+ import "../chunk-ZDINCHBS.mjs";
117
118
  import "../chunk-QWHUDAPC.mjs";
118
119
  import "../chunk-E4JVWPXS.mjs";
119
- import "../chunk-ZDINCHBS.mjs";
120
120
  import "../chunk-O7YCQQO5.mjs";
121
121
  import "../chunk-QSWIVDXC.mjs";
122
122
  import "../chunk-SPG47QW7.mjs";
123
123
  import "../chunk-K6S7R6LU.mjs";
124
- import "../chunk-X36ROB3X.mjs";
124
+ import "../chunk-B7GUGY22.mjs";
125
125
  import "../chunk-WZ6PXGGC.mjs";
126
126
  import "../chunk-7ZCOFATU.mjs";
127
127
  import "../chunk-JD6AELXS.mjs";
@@ -1,20 +1,20 @@
1
- import {
2
- enumLabel_gender,
3
- enum_gender
4
- } from "../chunk-RGUQWALX.mjs";
5
1
  import {
6
2
  MySelect
7
- } from "../chunk-UJXRBUI3.mjs";
8
- import "../chunk-QWHUDAPC.mjs";
9
- import "../chunk-E4JVWPXS.mjs";
3
+ } from "../chunk-J2ECF7CA.mjs";
10
4
  import {
11
5
  utils_converter
12
6
  } from "../chunk-ZDINCHBS.mjs";
7
+ import "../chunk-QWHUDAPC.mjs";
8
+ import "../chunk-E4JVWPXS.mjs";
13
9
  import "../chunk-O7YCQQO5.mjs";
14
10
  import "../chunk-QSWIVDXC.mjs";
15
11
  import "../chunk-SPG47QW7.mjs";
12
+ import {
13
+ enumLabel_gender,
14
+ enum_gender
15
+ } from "../chunk-RGUQWALX.mjs";
16
16
  import "../chunk-K6S7R6LU.mjs";
17
- import "../chunk-X36ROB3X.mjs";
17
+ import "../chunk-B7GUGY22.mjs";
18
18
  import "../chunk-WZ6PXGGC.mjs";
19
19
  import "../chunk-7ZCOFATU.mjs";
20
20
  import {
package/package.json CHANGED
@@ -58,7 +58,7 @@
58
58
  "types": "./dist/types/index.d.mts"
59
59
  }
60
60
  },
61
- "version": "0.1.925",
61
+ "version": "0.1.927",
62
62
  "private": false,
63
63
  "files": [
64
64
  "dist"