gomtm 0.0.363 → 0.0.365
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.
|
@@ -118,19 +118,29 @@ function useGomtmForm2() {
|
|
|
118
118
|
const handleValuesSubmit = useCallback((values) => __async(this, null, function* () {
|
|
119
119
|
try {
|
|
120
120
|
const result = yield mutation.mutateAsync(values);
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
console.log("result", result, "errCode", result.errCode);
|
|
122
|
+
const a = result;
|
|
123
|
+
if (a.errCode) {
|
|
124
|
+
toast("Error:" + a.errCode, {
|
|
125
|
+
description: a.errMessage.substring(0, 100),
|
|
126
|
+
closeButton: true
|
|
127
|
+
});
|
|
128
|
+
} else {
|
|
129
|
+
toast("OK", {
|
|
130
|
+
description: "ok",
|
|
131
|
+
// action: {
|
|
132
|
+
// label: "close",
|
|
133
|
+
// onClick: () => console.log("close"),
|
|
134
|
+
// },
|
|
135
|
+
closeButton: true
|
|
136
|
+
});
|
|
137
|
+
}
|
|
128
138
|
} catch (e) {
|
|
129
|
-
toast("
|
|
130
|
-
description:
|
|
139
|
+
toast("Unknown", {
|
|
140
|
+
description: e.toString(),
|
|
131
141
|
action: {
|
|
132
|
-
label: "
|
|
133
|
-
onClick: () => console.log("
|
|
142
|
+
label: "close",
|
|
143
|
+
onClick: () => console.log("close")
|
|
134
144
|
}
|
|
135
145
|
});
|
|
136
146
|
}
|
|
@@ -44,7 +44,8 @@ function useCurdRemove() {
|
|
|
44
44
|
const activateItem = useListview((x) => x.activateItem);
|
|
45
45
|
const queryClient = useQueryClient();
|
|
46
46
|
const handlerSubmit = useCallback(() => __async(this, null, function* () {
|
|
47
|
-
|
|
47
|
+
const aaa = mutation;
|
|
48
|
+
yield aaa.mutateAsync({
|
|
48
49
|
ids: [activateItem == null ? void 0 : activateItem.id.toString()]
|
|
49
50
|
});
|
|
50
51
|
}), [activateItem, mutation]);
|
package/dist/esm/gomtmQuery.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ import { MtmError } from "./gomtmpb/mtm/sppb/mtm_pb";
|
|
|
4
4
|
export declare function useGomtmQuery<T = any>(svc: string, method: string, input?: any): import("@tanstack/react-query").UseQueryResult<T, Error>;
|
|
5
5
|
export declare function useGomtmSuspenseQuery<T = any>(svc: string, method: string, input?: any): import("@tanstack/react-query").UseSuspenseQueryResult<T, Error>;
|
|
6
6
|
export declare function useGomtmSuspenseInfiniteQuery<T = any>(svc: string, method: string, input?: any): import("@tanstack/react-query").UseSuspenseInfiniteQueryResult<import("@tanstack/react-query").InfiniteData<T & PlainMessage<MtmError>, unknown>, Error>;
|
|
7
|
-
export declare function useGomtmMutation<TData =
|
|
7
|
+
export declare function useGomtmMutation<TData = any, TError = DefaultError, TVariables = any, TContext = unknown>(svc: string, method: string, options?: UseMutationOptions): import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
|
package/dist/esm/gomtmQuery.js
CHANGED
|
@@ -70,9 +70,13 @@ function useGomtmSuspenseInfiniteQuery(svc, method, input) {
|
|
|
70
70
|
}
|
|
71
71
|
function useGomtmMutation(svc, method, options) {
|
|
72
72
|
const fn = useGmtmQjeryFn();
|
|
73
|
-
|
|
74
|
-
mutationFn: (input) =>
|
|
73
|
+
const a = useMutation(__spreadProps(__spreadValues({}, options), {
|
|
74
|
+
mutationFn: (input) => {
|
|
75
|
+
const b = fn(svc, method, input);
|
|
76
|
+
return b;
|
|
77
|
+
}
|
|
75
78
|
}));
|
|
79
|
+
return a;
|
|
76
80
|
}
|
|
77
81
|
export {
|
|
78
82
|
useGomtmMutation,
|
package/dist/esm/lib/meta.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Metadata, ResolvingMetadata } from 'next';
|
|
2
|
-
type Props = {
|
|
2
|
+
export type Props = {
|
|
3
3
|
params: {
|
|
4
4
|
id: string;
|
|
5
5
|
};
|
|
@@ -8,4 +8,3 @@ type Props = {
|
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export declare function generateGomtmMetadata({ params, searchParams }: Props, parent: ResolvingMetadata): Promise<Metadata>;
|
|
11
|
-
export {};
|