aq-fe-framework 0.1.413 → 0.1.415
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.
|
@@ -227,21 +227,7 @@ function MyButtonCreateUpdate({
|
|
|
227
227
|
const queryClient = useQueryClient();
|
|
228
228
|
const mutation = useMyReactMutation({
|
|
229
229
|
axiosFn: (values) => {
|
|
230
|
-
|
|
231
|
-
if (result === void 0) {
|
|
232
|
-
return Promise.resolve({
|
|
233
|
-
data: {
|
|
234
|
-
message: "T\u1EA1o th\xE0nh c\xF4ng (gi\u1EA3 l\u1EADp)",
|
|
235
|
-
data: {},
|
|
236
|
-
isSuccess: 1
|
|
237
|
-
},
|
|
238
|
-
status: 200,
|
|
239
|
-
statusText: "OK",
|
|
240
|
-
headers: {},
|
|
241
|
-
config: {}
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
return result;
|
|
230
|
+
return values;
|
|
245
231
|
},
|
|
246
232
|
options: {
|
|
247
233
|
onSuccess: (...args) => {
|
|
@@ -276,7 +262,7 @@ function MyButtonCreateUpdate({
|
|
|
276
262
|
onClick: disclosure[1].open,
|
|
277
263
|
leftSection: /* @__PURE__ */ jsx4(IconPlus3, {})
|
|
278
264
|
}, buttonProps), {
|
|
279
|
-
children: "Th\xEAm"
|
|
265
|
+
children: (buttonProps == null ? void 0 : buttonProps.children) || "Th\xEAm"
|
|
280
266
|
})
|
|
281
267
|
),
|
|
282
268
|
/* @__PURE__ */ jsx4(
|
|
@@ -296,8 +282,23 @@ function MyButtonCreateUpdate({
|
|
|
296
282
|
{
|
|
297
283
|
onSubmit: form.onSubmit((values) => {
|
|
298
284
|
const result = onSubmit(values);
|
|
285
|
+
let axiosPromise;
|
|
299
286
|
if (result == false) return;
|
|
300
|
-
|
|
287
|
+
if (result == void 0) {
|
|
288
|
+
axiosPromise = Promise.resolve({
|
|
289
|
+
data: {
|
|
290
|
+
message: "T\u1EA1o th\xE0nh c\xF4ng (gi\u1EA3 l\u1EADp)",
|
|
291
|
+
data: {},
|
|
292
|
+
isSuccess: 1
|
|
293
|
+
},
|
|
294
|
+
status: 200,
|
|
295
|
+
statusText: "OK",
|
|
296
|
+
headers: {},
|
|
297
|
+
config: {}
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
axiosPromise = result;
|
|
301
|
+
mutation.mutate(axiosPromise);
|
|
301
302
|
}),
|
|
302
303
|
children: [
|
|
303
304
|
/* @__PURE__ */ jsx4(
|
package/dist/core/index.d.mts
CHANGED
|
@@ -16,11 +16,11 @@ interface CoreActionIconProps extends Omit<React.ButtonHTMLAttributes<HTMLButton
|
|
|
16
16
|
}
|
|
17
17
|
declare function MyActionIcon({ children, actionType, ...rest }: CoreActionIconProps): react_jsx_runtime.JSX.Element;
|
|
18
18
|
|
|
19
|
-
interface
|
|
19
|
+
interface MyButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ButtonProps {
|
|
20
20
|
actionType?: type_action;
|
|
21
21
|
children?: ReactNode;
|
|
22
22
|
}
|
|
23
|
-
declare function MyButton({ children, actionType, ...rest }:
|
|
23
|
+
declare function MyButton({ children, actionType, ...rest }: MyButtonProps): react_jsx_runtime.JSX.Element;
|
|
24
24
|
|
|
25
25
|
interface CoreButtonCreateUpdateProps<IReq, IRes> {
|
|
26
26
|
modalProps?: Omit<ModalProps, "opened" | "onClose">;
|
package/dist/core/index.mjs
CHANGED