fix(FormFooter, useCreateCustomerPresenter): disable submit button during mutation

- Added a disabled state to the submit button in FormFooter to prevent multiple submissions while a mutation is in progress.
- Included a blank line in useCreateCustomerPresenter for improved code readability.
This commit is contained in:
AmirReza Jamali
2026-04-13 19:33:11 +03:30
parent c93a1ffe8d
commit fb3301169e
2 changed files with 2 additions and 0 deletions
@@ -31,6 +31,7 @@ const useCreateCustomerPresenter = ({
mode: "onChange",
defaultValues,
});
const router = useRouter();
const { mutate: createCustomer, isPending: isCreating } = useCreateCustomer();
const { mutate: updateCustomer, isPending: isUpdating } = useUpdateCustomer(
+1
View File
@@ -13,6 +13,7 @@ const FormFooter = ({ onCancel }: IProps) => {
<div className="col-span-2 flex gap-6">
<button
type="submit"
disabled={isMutating > 0}
className="mt-6 flex w-fit items-center justify-center rounded-lg bg-primary p-[13px] font-medium text-white hover:bg-opacity-90"
>
{isMutating ? (