diff --git a/apps/admin-panel/app/committees/create.tsx b/apps/admin-panel/app/committees/create.tsx index 12007f8d7..d9577a824 100644 --- a/apps/admin-panel/app/committees/create.tsx +++ b/apps/admin-panel/app/committees/create.tsx @@ -38,7 +38,10 @@ export const CreateCommitteeDialog: React.FC = ({ openCreateCommitteeDialog, }) => { const { navigate, isNavigating } = useModalNavigation({ - closeModal: () => setOpenCreateCommitteeDialog(false), + closeModal: () => { + setOpenCreateCommitteeDialog(false) + resetForm() + }, }) const [createCommittee, { loading, reset, error: createCommitteeError }] = diff --git a/apps/admin-panel/app/customers/create.tsx b/apps/admin-panel/app/customers/create.tsx index 688ef8277..22b83e5af 100644 --- a/apps/admin-panel/app/customers/create.tsx +++ b/apps/admin-panel/app/customers/create.tsx @@ -158,7 +158,10 @@ export const CreateCustomerDialog: React.FC = ({ openCreateCustomerDialog, }) => { const { navigate, isNavigating } = useModalNavigation({ - closeModal: () => setOpenCreateCustomerDialog(false), + closeModal: () => { + setOpenCreateCustomerDialog(false) + resetForm() + }, }) const [createCustomer, { loading, reset, error: createCustomerError }] = @@ -203,7 +206,6 @@ export const CreateCustomerDialog: React.FC = ({ onCompleted: (data) => { if (data?.customerCreate.customer) { toast.success("Customer created successfully") - resetForm() navigate(`/customers/${data.customerCreate.customer.customerId}`) } else { throw new Error("Failed to create customer. Please try again.") diff --git a/apps/admin-panel/app/terms-templates/create.tsx b/apps/admin-panel/app/terms-templates/create.tsx index 56dd45605..d5d226751 100644 --- a/apps/admin-panel/app/terms-templates/create.tsx +++ b/apps/admin-panel/app/terms-templates/create.tsx @@ -48,7 +48,10 @@ export const CreateTermsTemplateDialog: React.FC openCreateTermsTemplateDialog, }) => { const { navigate, isNavigating } = useModalNavigation({ - closeModal: () => setOpenCreateTermsTemplateDialog(false), + closeModal: () => { + setOpenCreateTermsTemplateDialog(false) + resetForm() + }, }) const [createTermsTemplate, { loading, error: createTermsTemplateError }] =