[skip ci] update search customer on add and edit transferfee
This commit is contained in:
@ -9,7 +9,8 @@ import {
|
|||||||
KeenIcon,
|
KeenIcon,
|
||||||
useDataGrid
|
useDataGrid
|
||||||
} from '@/components';
|
} from '@/components';
|
||||||
import { useCallApi } from '@/hooks';3
|
import { useCallApi } from '@/hooks';
|
||||||
|
3;
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogBody,
|
DialogBody,
|
||||||
@ -144,7 +145,6 @@ const resetForm = () => {
|
|||||||
const [showTransactionFeeDialog, setShowTransactionFeeDialog] = useState(false);
|
const [showTransactionFeeDialog, setShowTransactionFeeDialog] = useState(false);
|
||||||
const parsedUser = getAuth()?.user;
|
const parsedUser = getAuth()?.user;
|
||||||
|
|
||||||
|
|
||||||
const useDebounce = (value: string, delay: number) => {
|
const useDebounce = (value: string, delay: number) => {
|
||||||
const [debouncedValue, setDebouncedValue] = useState(value);
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
||||||
|
|
||||||
@ -307,7 +307,6 @@ const debouncedCreditSearchTerm = useDebounce(creditSearchTerm, 500);
|
|||||||
}
|
}
|
||||||
}, [debouncedDeductSearchTerm, openDeductOrigin, formField.deduct_from, searchDeductCustomers]);
|
}, [debouncedDeductSearchTerm, openDeductOrigin, formField.deduct_from, searchDeductCustomers]);
|
||||||
|
|
||||||
|
|
||||||
const searchCreditCustomers = useCallback(
|
const searchCreditCustomers = useCallback(
|
||||||
async (searchTerm: string) => {
|
async (searchTerm: string) => {
|
||||||
setIsSearchingCreditCustomers(true);
|
setIsSearchingCreditCustomers(true);
|
||||||
@ -347,7 +346,12 @@ const debouncedCreditSearchTerm = useDebounce(creditSearchTerm, 500);
|
|||||||
if (openCreditDestination && formField.credit_to === 'I') {
|
if (openCreditDestination && formField.credit_to === 'I') {
|
||||||
searchCreditCustomers(debouncedCreditSearchTerm);
|
searchCreditCustomers(debouncedCreditSearchTerm);
|
||||||
}
|
}
|
||||||
}, [debouncedCreditSearchTerm, openCreditDestination, formField.credit_to, searchCreditCustomers]);
|
}, [
|
||||||
|
debouncedCreditSearchTerm,
|
||||||
|
openCreditDestination,
|
||||||
|
formField.credit_to,
|
||||||
|
searchCreditCustomers
|
||||||
|
]);
|
||||||
|
|
||||||
const doCreateTransferType = useCallback(
|
const doCreateTransferType = useCallback(
|
||||||
async (e: React.FormEvent<HTMLFormElement>) => {
|
async (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
|
|||||||
@ -793,7 +793,6 @@ useEffect(() => {
|
|||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
setDeductSearchTerm(value);
|
setDeductSearchTerm(value);
|
||||||
|
|
||||||
}}
|
}}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
|||||||
Reference in New Issue
Block a user