Sfoglia il codice sorgente

update

tags/Baseline_30082024_FRONTEND_UAT
MSI\derek 1 anno fa
parent
commit
2f8520c6ee
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      src/components/EditStaff/EditStaff.tsx

+ 2
- 2
src/components/EditStaff/EditStaff.tsx Vedi File

@@ -108,7 +108,7 @@ const EditStaff: React.FC<formProps> = ({ Staff, combos }) => {
haveError = true
formProps.setError("phone1", { message: t("Please Enter Correct Phone No.."), type: "required" })
}
if(!regex_phone.test(data.emergContactPhone)) {
if(data.emergContactPhone && !regex_phone.test(data.emergContactPhone)) {
haveError = true
formProps.setError("emergContactPhone", { message: t("Please Enter Correct Phone No.."), type: "required" })
}
@@ -150,7 +150,7 @@ const EditStaff: React.FC<formProps> = ({ Staff, combos }) => {
haveError = true
formProps.setError("joinDate", { message: t("Please Enter Join Date."), type: "required" })
}
if (data.departDate && new Date(data.departDate) <= new Date(data.joinDate)) {
if (data.joinDate &&data.departDate && new Date(data.departDate) <= new Date(data.joinDate)) {
haveError = true
formProps.setError("departDate", { message: t("Depart Date cannot be earlier than Join Date."), type: "required" })
}


Caricamento…
Annulla
Salva