Skip to content

Commit

Permalink
Fix setTotalDoctors in FacilityStaffList
Browse files Browse the repository at this point in the history
  • Loading branch information
shauryag2002 committed Dec 7, 2024
1 parent 4d0a553 commit 4fb718c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Facility/FacilityStaffList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export const FacilityStaffList = (props: any) => {
offset: (qParams.page - 1) * resultsPerPage,
},
onResponse: ({ res, data }) => {
if (res?.ok && data) {
setTotalDoctors(data?.total_doctors ?? 0);
if (res?.ok && data?.results.length) {
setTotalDoctors(data.results[0]?.total_doctors ?? 0);
}
},
});
Expand Down
1 change: 1 addition & 0 deletions src/components/Facility/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export interface DoctorModal {
id?: number;
area?: number;
count?: number;
total_doctors?: number;
}

export interface OptionsType {
Expand Down

0 comments on commit 4fb718c

Please sign in to comment.