Skip to content

Commit

Permalink
coderabbit suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker committed Nov 26, 2024
1 parent e6f204f commit c9d20eb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1717,3 +1717,5 @@ export const HEADER_CONTENT_TYPES = {
svg: "image/svg+xml",
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
} as const;

export const ADMIN_USER_TYPES = ["DistrictAdmin", "StateAdmin"] as const;
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { UserModel } from "@/components/Users/models";

import useAuthUser from "@/hooks/useAuthUser";

import { ADMIN_USER_TYPES } from "@/common/constants";

import { PatientProps } from ".";
import * as Notification from "../../../Utils/Notifications";
import { PatientModel } from "../models";
Expand Down Expand Up @@ -41,8 +43,6 @@ export const HealthProfileSummary = (props: PatientProps) => {
));
}

const ADMIN_USER_TYPES = ["DistrictAdmin", "StateAdmin"] as const;

const canEditPatient = (authUser: UserModel, patientData: PatientModel) => {
return (
ADMIN_USER_TYPES.includes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { UserModel } from "@/components/Users/models";

import useAuthUser from "@/hooks/useAuthUser";

import { ADMIN_USER_TYPES } from "@/common/constants";

import { formatDateTime } from "@/Utils/utils";

import { PatientProps } from ".";
Expand All @@ -25,8 +27,6 @@ export const ImmunisationRecords = (props: PatientProps) => {
);
};

const ADMIN_USER_TYPES = ["DistrictAdmin", "StateAdmin"] as const;

const canEditPatient = (authUser: UserModel, patientData: PatientModel) => {
return (
ADMIN_USER_TYPES.includes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const SampleTestHistory = (props: PatientProps) => {
const [_showAlertMessage, setShowAlertMessage] = useState(false);

const isPatientInactive = (patientData: PatientModel, facilityId: string) => {
if (!patientData) return true;
return (
!patientData.is_active ||
!(
Expand Down

0 comments on commit c9d20eb

Please sign in to comment.