loading button
This commit is contained in:
@@ -9,7 +9,7 @@ import Select from '../../components/Select';
|
||||
import * as Yup from 'yup'
|
||||
import { useFormik } from 'formik';
|
||||
import { CreateCustomerType, ProvinesItemType } from './types/CustomerTypes';
|
||||
import { useCreateCustomer, useGetCities, useGetCustomerDetail, useGetProvines, useUpdateCustomer } from './hooks/useCustomerData';
|
||||
import { useGetCities, useGetCustomerDetail, useGetProvines, useUpdateCustomer } from './hooks/useCustomerData';
|
||||
import PageLoading from '../../components/PageLoading';
|
||||
import { toast } from 'react-toastify';
|
||||
import { ErrorType } from '../../helpers/types';
|
||||
@@ -28,7 +28,6 @@ const UpdateCustomer: FC = () => {
|
||||
const getProvines = useGetProvines()
|
||||
const getCities = useGetCities(provinesId)
|
||||
const singleUpload = useSingleUpload()
|
||||
const createCustomer = useCreateCustomer()
|
||||
const getDetailCustomer = useGetCustomerDetail(id)
|
||||
const updateCustomer = useUpdateCustomer(id ? id : '')
|
||||
|
||||
@@ -140,7 +139,7 @@ const UpdateCustomer: FC = () => {
|
||||
<Button
|
||||
className='px-5'
|
||||
onClick={() => formik.handleSubmit()}
|
||||
isLoading={createCustomer.isPending || singleUpload.isPending}
|
||||
isLoading={updateCustomer.isPending || singleUpload.isPending}
|
||||
>
|
||||
<div className='flex gap-2'>
|
||||
<TickCircle
|
||||
|
||||
Reference in New Issue
Block a user