From dd887bc0aaf813a49bb66b4415731eea6e786e2f Mon Sep 17 00:00:00 2001 From: Kshitij Verma Date: Fri, 29 Sep 2023 20:14:31 +0530 Subject: [PATCH] fixed asset import modal page --- src/Components/Assets/AssetImportModal.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Components/Assets/AssetImportModal.tsx b/src/Components/Assets/AssetImportModal.tsx index 16acb6d2dd9..9b9a3c30679 100644 --- a/src/Components/Assets/AssetImportModal.tsx +++ b/src/Components/Assets/AssetImportModal.tsx @@ -39,21 +39,18 @@ const AssetImportModal = ({ open, onClose, facility }: Props) => { setSelectedFile(undefined); onClose && onClose(); }; - const { - data: facilityAssetLocations, - loading, - refetch, - } = useQuery(routes.listFacilityAssetLocation, { - pathParams: { facility_external_id: `${facility.id}` }, - }); + const { data: facilityAssetLocations, loading } = useQuery( + routes.listFacilityAssetLocation, + { + pathParams: { facility_external_id: `${facility.id}` }, + } + ); useEffect(() => { - if (!facilityAssetLocations) { - () => refetch(); - } else if (facilityAssetLocations?.count) { + if (facilityAssetLocations?.count) { setLocations(facilityAssetLocations?.results); } - }, [facilityAssetLocations, refetch]); + }, [facilityAssetLocations]); useEffect(() => { const readFile = async () => {