MCPcopy Create free account
hub / github.com/code-with-antonio/nodebase / onSubmit

Function onSubmit

src/features/credentials/components/credential.tsx:95–111  ·  view source on GitHub ↗
(values: FormValues)

Source from the content-addressed store, hash-verified

93 });
94
95 const onSubmit = async (values: FormValues) => {
96 if (isEdit && initialData?.id) {
97 await updateCredential.mutateAsync({
98 id: initialData.id,
99 ...values,
100 })
101 } else {
102 await createCredential.mutateAsync(values, {
103 onSuccess: (data) => {
104 router.push(`/credentials/${data.id}`);
105 },
106 onError: (error) => {
107 handleError(error);
108 }
109 })
110 }
111 }
112
113 return (
114 <>

Callers

nothing calls this directly

Calls 1

handleErrorFunction · 0.85

Tested by

no test coverage detected