From 198ada2f3b85863c7468682959bc56dd8ba49341 Mon Sep 17 00:00:00 2001 From: sriharsh05 Date: Thu, 16 Nov 2023 12:10:20 +0530 Subject: [PATCH] fix failing api calls --- src/Components/Facility/FacilityCreate.tsx | 4 ++-- src/Redux/api.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/Facility/FacilityCreate.tsx b/src/Components/Facility/FacilityCreate.tsx index 24d91d25a5d..32a1c554de0 100644 --- a/src/Components/Facility/FacilityCreate.tsx +++ b/src/Components/Facility/FacilityCreate.tsx @@ -175,10 +175,10 @@ export const FacilityCreate = (props: FacilityProps) => { }, }); if (res?.ok && data) { - setDistricts([data]); + setDistricts(data); } setIsDistrictLoading(false); - return res ? [data] : []; + return res ? data : []; } }; diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx index a9e29f6b6ae..2182942a923 100644 --- a/src/Redux/api.tsx +++ b/src/Redux/api.tsx @@ -261,7 +261,7 @@ const routes = { }, updateFacility: { - path: "/api/v1/facility", + path: "/api/v1/facility/{id}/", method: "PUT", TRes: Type(), }, @@ -633,7 +633,7 @@ const routes = { }, getDistrictByState: { path: "/api/v1/state/{id}/districts/", - TRes: Type(), + TRes: Type(), }, getDistrictByName: { path: "/api/v1/district/",