From 1de2999c6bd305d2e26b19ddcdd6b65f15598af6 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Fri, 10 May 2024 18:28:06 +0530 Subject: [PATCH] avoid any's --- src/Components/Patient/PatientRegister.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx index cfc497a289..383edbe78d 100644 --- a/src/Components/Patient/PatientRegister.tsx +++ b/src/Components/Patient/PatientRegister.tsx @@ -29,7 +29,7 @@ import CollapseV2 from "../Common/components/CollapseV2"; import ConfirmDialog from "../Common/ConfirmDialog"; import DateFormField from "../Form/FormFields/DateFormField"; import DialogModal from "../Common/Dialog"; -import { DupPatientModel } from "../Facility/models"; +import { DistrictModel, DupPatientModel, WardModel } from "../Facility/models"; import DuplicatePatientDialog from "../Facility/DuplicatePatientDialog"; import { FieldError, @@ -64,6 +64,7 @@ import routes from "../../Redux/api.js"; import request from "../../Utils/request/request.js"; import SelectMenuV2 from "../Form/SelectMenuV2.js"; import Checkbox from "../Common/components/CheckBox.js"; +import { ILocalBodies } from "../ExternalResult/models.js"; const Loading = lazy(() => import("../Common/Loading")); const PageTitle = lazy(() => import("../Common/PageTitle")); @@ -205,9 +206,9 @@ export const PatientRegister = (props: PatientRegisterProps) => { const [isDistrictLoading, setIsDistrictLoading] = useState(false); const [isLocalbodyLoading, setIsLocalbodyLoading] = useState(false); const [isWardLoading, setIsWardLoading] = useState(false); - const [districts, setDistricts] = useState([]); - const [localBody, setLocalBody] = useState([]); - const [ward, setWard] = useState([]); + const [districts, setDistricts] = useState([]); + const [localBody, setLocalBody] = useState([]); + const [ward, setWard] = useState([]); const [ageInputType, setAgeInputType] = useState< "date_of_birth" | "age" | "alert_for_age" >("date_of_birth"); @@ -1749,9 +1750,9 @@ export const PatientRegister = (props: PatientRegisterProps) => { } disabled={!field("district").value} options={localBody} - optionLabel={(o: any) => o.name} - optionValue={(o: any) => o.id} - onChange={(e: any) => { + optionLabel={(o) => o.name} + optionValue={(o) => o.id} + onChange={(e) => { field("local_body").onChange(e); field("ward").onChange({ name: "ward",