Skip to content

Commit

Permalink
fix failing api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sriharsh05 committed Nov 16, 2023
1 parent f04ee87 commit 198ada2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Components/Facility/FacilityCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 : [];
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/Redux/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ const routes = {
},

updateFacility: {
path: "/api/v1/facility",
path: "/api/v1/facility/{id}/",
method: "PUT",
TRes: Type<FacilityModel>(),
},
Expand Down Expand Up @@ -633,7 +633,7 @@ const routes = {
},
getDistrictByState: {
path: "/api/v1/state/{id}/districts/",
TRes: Type<StateModel>(),
TRes: Type<StateModel[]>(),
},
getDistrictByName: {
path: "/api/v1/district/",
Expand Down

0 comments on commit 198ada2

Please sign in to comment.