aq-fe-framework 0.1.402 → 0.1.403

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.
@@ -226,10 +226,9 @@ function MyButtonCreateUpdate({
226
226
  const disclosure = externalDisclosure != null ? externalDisclosure : defaultDisclosure;
227
227
  const queryClient = useQueryClient();
228
228
  const mutation = useMyReactMutation({
229
- axiosFn: (values) => {
230
- const result = onSubmit(values);
231
- if (result === void 0) {
232
- return Promise.resolve({
229
+ axiosFn: async (values) => {
230
+ if (onSubmit === true) {
231
+ return {
233
232
  data: {
234
233
  message: "T\u1EA1o th\xE0nh c\xF4ng (gi\u1EA3 l\u1EADp)",
235
234
  data: {},
@@ -239,9 +238,22 @@ function MyButtonCreateUpdate({
239
238
  statusText: "OK",
240
239
  headers: {},
241
240
  config: {}
242
- });
241
+ };
243
242
  }
244
- return result;
243
+ if (onSubmit === false) {
244
+ return {
245
+ data: {
246
+ message: "T\u1EA1o th\u1EA5t b\u1EA1i (gi\u1EA3 l\u1EADp)",
247
+ data: {},
248
+ isSuccess: 1
249
+ },
250
+ status: 500,
251
+ statusText: "OK",
252
+ headers: {},
253
+ config: {}
254
+ };
255
+ }
256
+ return await onSubmit(values);
245
257
  },
246
258
  options: {
247
259
  onSuccess: (...args) => {
@@ -28,7 +28,7 @@ interface CoreButtonCreateUpdateProps<IReq, IRes> {
28
28
  buttonProps?: ButtonProps;
29
29
  scrollAreaAutosizeProps?: ScrollAreaAutosizeProps;
30
30
  isUpdate?: boolean;
31
- onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>> | void;
31
+ onSubmit: ((values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>>) | boolean;
32
32
  onSuccess?: (...args: any[]) => void;
33
33
  onError?: (...args: any[]) => void;
34
34
  ignoreDefaultOnSuccess?: boolean;
@@ -13,7 +13,7 @@ import {
13
13
  MyStatsCard,
14
14
  MyTextInput,
15
15
  MyWeeklySessionSchedulerPicker
16
- } from "../chunk-PQ3X2HRM.mjs";
16
+ } from "../chunk-H46FC3HW.mjs";
17
17
  import "../chunk-GEYCGM75.mjs";
18
18
  import "../chunk-7ORPZMGL.mjs";
19
19
  import "../chunk-K6S7R6LU.mjs";
@@ -5,12 +5,6 @@ import {
5
5
  utils_converter_enumToSelectOptions,
6
6
  utils_file_fileToAQDocumentType
7
7
  } from "../chunk-P3IR7UL7.mjs";
8
- import {
9
- baseColumns
10
- } from "../chunk-2SBUKAGS.mjs";
11
- import {
12
- U0DateToDDMMYYYString
13
- } from "../chunk-I2XIN2R3.mjs";
14
8
  import {
15
9
  F_authenticate_Logout,
16
10
  MyActionIconDelete,
@@ -38,6 +32,12 @@ import {
38
32
  createGenericStore
39
33
  } from "../chunk-Y3YGC5IH.mjs";
40
34
  import "../chunk-5U2JSHSJ.mjs";
35
+ import {
36
+ baseColumns
37
+ } from "../chunk-2SBUKAGS.mjs";
38
+ import {
39
+ U0DateToDDMMYYYString
40
+ } from "../chunk-I2XIN2R3.mjs";
41
41
  import {
42
42
  const_object_documentTypes
43
43
  } from "../chunk-BZMQOGL6.mjs";
@@ -45,7 +45,7 @@ import {
45
45
  MyButton as MyButton2,
46
46
  MyDataTableSelectOne,
47
47
  MyTextInput as MyTextInput2
48
- } from "../chunk-PQ3X2HRM.mjs";
48
+ } from "../chunk-H46FC3HW.mjs";
49
49
  import {
50
50
  MyDataTable,
51
51
  MyFlexColumn,
@@ -19,15 +19,15 @@ import {
19
19
  utils_time_getCurrentTimeString,
20
20
  utils_validator_validateCode
21
21
  } from "../chunk-P3IR7UL7.mjs";
22
+ import {
23
+ utils_pdf_download
24
+ } from "../chunk-5U2JSHSJ.mjs";
22
25
  import {
23
26
  U0DateToDDMMYYYString,
24
27
  utils_date_dateToDDMMYYYString,
25
28
  utils_date_formatToDateTimeStartEnd,
26
29
  utils_date_getHHmm
27
30
  } from "../chunk-I2XIN2R3.mjs";
28
- import {
29
- utils_pdf_download
30
- } from "../chunk-5U2JSHSJ.mjs";
31
31
  import {
32
32
  utils_notification_show
33
33
  } 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.402",
45
+ "version": "0.1.403",
46
46
  "private": false,
47
47
  "files": [
48
48
  "dist"