(values: FormValues)
| 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 | <> |
nothing calls this directly
no test coverage detected