Skip to content

Commit

Permalink
Remove facility name from facility users page (ohcnetwork#9746)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahendar0701 authored and AdityaJ2305 committed Jan 5, 2025
1 parent 0f1bce7 commit 00f1150
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/components/Facility/FacilityUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import useFilters from "@/hooks/useFilters";

import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import useTanStackQueryInstead from "@/Utils/request/useQuery";

export default function FacilityUsers(props: { facilityId: number }) {
const { t } = useTranslation();
Expand All @@ -22,16 +21,6 @@ export default function FacilityUsers(props: { facilityId: number }) {
const [activeTab, setActiveTab] = useState(0);
const { facilityId } = props;

const { data: facilityData } = useTanStackQueryInstead(
routes.getAnyFacility,
{
pathParams: {
id: facilityId,
},
prefetch: facilityId !== undefined,
},
);

const { data: userListData, isLoading: userListLoading } = useQuery({
queryKey: ["facilityUsers", facilityId],
queryFn: query(routes.facility.getUsers, {
Expand All @@ -44,15 +33,11 @@ export default function FacilityUsers(props: { facilityId: number }) {
return <div>Loading...</div>;
}
if (!userListData) {
return <div>No users found</div>;
return <div>{t("no_users_found")}</div>;
}

return (
<Page
title={`${t("users")} - ${facilityData?.name}`}
hideBack={true}
breadcrumbs={false}
>
<Page title={`${t("users")}`} hideBack={true} breadcrumbs={false}>
<CountBlock
text={t("total_users")}
count={userListData.count}
Expand Down

0 comments on commit 00f1150

Please sign in to comment.