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