mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
added toasts
This commit is contained in:
parent
ef959af711
commit
39e801f6f3
10 changed files with 92 additions and 7 deletions
|
@ -44,7 +44,6 @@ export const useCommentFormFormik = (
|
|||
await sendData(values);
|
||||
onSuccess(helpers)();
|
||||
} catch (error) {
|
||||
console.log('error', error);
|
||||
onSuccess(helpers)(error);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -8,14 +8,13 @@ import { showErrorToast } from '~/utils/errors/showToast';
|
|||
|
||||
const validationSchema = object().shape({});
|
||||
|
||||
const afterSubmit = ({ resetForm, setStatus, setSubmitting, setErrors }: FormikHelpers<INode>) => (
|
||||
const afterSubmit = ({ resetForm, setSubmitting, setErrors }: FormikHelpers<INode>) => (
|
||||
e?: string,
|
||||
errors?: Record<string, string>
|
||||
) => {
|
||||
setSubmitting(false);
|
||||
|
||||
if (e) {
|
||||
setStatus(e);
|
||||
showErrorToast(e);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue