Skip to content

Commit

Permalink
fix: Resolve creation of patient name despite having numeric values (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanuj1718 authored and Rishith25 committed Nov 25, 2024
1 parent e7c3210 commit 8dfdf34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Patient/PatientRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import {
} from "@/common/constants";
import countryList from "@/common/static/countries.json";
import { statusType, useAbortableEffect } from "@/common/utils";
import { validatePincode } from "@/common/validation";
import { validateName, validatePincode } from "@/common/validation";

import { PLUGIN_Component } from "@/PluginEngine";
import { RestoreDraftButton } from "@/Utils/AutoSave";
Expand Down Expand Up @@ -421,6 +421,10 @@ export const PatientRegister = (props: PatientRegisterProps) => {
switch (field) {
case "address":
case "name":
if (!validateName(form[field])) {
errors[field] = "Please enter valid name";
}
return;
case "gender":
errors[field] = RequiredFieldValidator()(form[field]);
return;
Expand Down

0 comments on commit 8dfdf34

Please sign in to comment.