gomtm 0.0.362 → 0.0.363

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.
@@ -53,6 +53,7 @@ var __async = (__this, __arguments, generator) => {
53
53
  import { jsx, jsxs } from "react/jsx-runtime";
54
54
  import { createContext, useCallback, useContext, useMemo, useRef } from "react";
55
55
  import { useForm } from "react-hook-form";
56
+ import { toast } from "sonner";
56
57
  import { useStore } from "zustand";
57
58
  import { createStore } from "zustand/vanilla";
58
59
  import { useGomtmMutation } from "../../gomtmQuery";
@@ -115,7 +116,24 @@ function useGomtmForm2() {
115
116
  _setOpen(open);
116
117
  }, [_setOpen]);
117
118
  const handleValuesSubmit = useCallback((values) => __async(this, null, function* () {
118
- const result = yield mutation.mutateAsync(values);
119
+ try {
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
+ });
128
+ } catch (e) {
129
+ toast("Error", {
130
+ description: "Sunday, December 03, 2023 at 9:00 AM",
131
+ action: {
132
+ label: "Undo",
133
+ onClick: () => console.log("Undo")
134
+ }
135
+ });
136
+ }
119
137
  setOpen(false);
120
138
  }), [setOpen, mutation]);
121
139
  const handleFormSubmit = useCallback(() => {