Skip to content

Commit

Permalink
fixed asset import modal page
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijv256 committed Sep 29, 2023
1 parent d90b17a commit dd887bc
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/Components/Assets/AssetImportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit dd887bc

Please sign in to comment.