From 864d5e6936c8f7534338407bf6fd2d802f3389a0 Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Sat, 11 May 2024 04:27:53 +0530 Subject: [PATCH] shifted to lodash --- src/Components/Patient/PatientRegister.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx index bde2bac5244..77ccd030027 100644 --- a/src/Components/Patient/PatientRegister.tsx +++ b/src/Components/Patient/PatientRegister.tsx @@ -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 _ from "lodash"; const Loading = lazy(() => import("../Common/Loading")); const PageTitle = lazy(() => import("../Common/PageTitle")); @@ -800,10 +801,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { : null : null, test_type: formData.test_type, - name: formData.name - .split(" ") - .map((i: string) => i.charAt(0).toUpperCase() + i.slice(1)) - .join(" "), + name: _.startCase(_.toLower(formData.name)), pincode: formData.pincode ? formData.pincode : undefined, gender: Number(formData.gender), nationality: formData.nationality,