gomtm 0.0.363 → 0.0.364

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,13 +118,26 @@ function useGomtmForm2() {
118
118
  const handleValuesSubmit = useCallback((values) => __async(this, null, function* () {
119
119
  try {
120
120
  const result = yield mutation.mutateAsync(values);
121
- toast("OK", {
122
- description: JSON.stringify(result, null, 2),
123
- action: {
124
- label: "Undo",
125
- onClick: () => console.log("Undo")
126
- }
127
- });
121
+ console.log("result", result);
122
+ const a = result;
123
+ if (a.errCode) {
124
+ toast("Error:" + a.errCode, {
125
+ description: a.errMessage,
126
+ action: {
127
+ label: "Undo",
128
+ onClick: () => console.log("Undo")
129
+ }
130
+ });
131
+ } else {
132
+ toast("OK", {
133
+ // description: JSON.stringify(result, null, 2),
134
+ description: "ok",
135
+ action: {
136
+ label: "Undo",
137
+ onClick: () => console.log("Undo")
138
+ }
139
+ });
140
+ }
128
141
  } catch (e) {
129
142
  toast("Error", {
130
143
  description: "Sunday, December 03, 2023 at 9:00 AM",
@@ -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
- yield mutation.mutateAsync({
47
+ const aaa = mutation;
48
+ yield aaa.mutateAsync({
48
49
  ids: [activateItem == null ? void 0 : activateItem.id.toString()]
49
50
  });
50
51
  }), [activateItem, mutation]);
@@ -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 = unknown, TError = DefaultError, TVariables = void, TContext = unknown>(svc: string, method: string, options?: UseMutationOptions): import("@tanstack/react-query").UseMutationResult<TData, any, any, any>;
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>;
@@ -70,9 +70,13 @@ function useGomtmSuspenseInfiniteQuery(svc, method, input) {
70
70
  }
71
71
  function useGomtmMutation(svc, method, options) {
72
72
  const fn = useGmtmQjeryFn();
73
- return useMutation(__spreadProps(__spreadValues({}, options), {
74
- mutationFn: (input) => fn(svc, method, 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,