aq-fe-framework 0.1.306 → 0.1.307
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/core/index.d.mts +1 -1
- package/dist/core/index.mjs +17 -1
- package/package.json +1 -1
package/dist/core/index.d.mts
CHANGED
@@ -24,7 +24,7 @@ interface CoreButtonCreateUpdateProps<IReq, IRes> {
|
|
24
24
|
actionIconProps?: ActionIconProps;
|
25
25
|
buttonProps?: ButtonProps;
|
26
26
|
isUpdate?: boolean;
|
27
|
-
onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes
|
27
|
+
onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>> | void;
|
28
28
|
onSuccess?: () => void;
|
29
29
|
onError?: () => void;
|
30
30
|
form: UseFormReturnType<IReq>;
|
package/dist/core/index.mjs
CHANGED
@@ -205,7 +205,23 @@ function CoreButtonCreateUpdate({
|
|
205
205
|
const disclosure = externalDisclosure != null ? externalDisclosure : defaultDisclosure;
|
206
206
|
const queryClient = useQueryClient();
|
207
207
|
const mutation = useMyReactMutation({
|
208
|
-
axiosFn: (values) =>
|
208
|
+
axiosFn: (values) => {
|
209
|
+
const result = onSubmit(values);
|
210
|
+
if (result === void 0) {
|
211
|
+
return Promise.resolve({
|
212
|
+
data: {
|
213
|
+
message: "T\u1EA1o th\xE0nh c\xF4ng (gi\u1EA3 l\u1EADp)",
|
214
|
+
data: {},
|
215
|
+
isSuccess: 1
|
216
|
+
},
|
217
|
+
status: 200,
|
218
|
+
statusText: "OK",
|
219
|
+
headers: {},
|
220
|
+
config: {}
|
221
|
+
});
|
222
|
+
}
|
223
|
+
return result;
|
224
|
+
},
|
209
225
|
options: __spreadValues(__spreadValues({
|
210
226
|
onSuccess: () => {
|
211
227
|
queryClient.invalidateQueries();
|