Stop the api from calling multiple times
const { data: customerDetails, error } = useCustom<
CustomerSearchResponse,
ApiErrorResponse
>({
method: 'get',
url:
errorNotification: (error: ApiErrorResponse | undefined) => {
return {
message: error?.detailedMessage || '',
type: 'error',
};
},
queryOptions: { enabled: isApiEnabled },
});
CustomerSearchResponse,
ApiErrorResponse
>({
method: 'get',
url:
${apiUrl}/${apiPaths.customer.searchCustomer(searchDetail)},errorNotification: (error: ApiErrorResponse | undefined) => {
return {
message: error?.detailedMessage || '',
type: 'error',
};
},
queryOptions: { enabled: isApiEnabled },
});
