We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc10931 commit ce6ad18Copy full SHA for ce6ad18
epictrack-web/src/components/staff/StaffForm.tsx
@@ -17,7 +17,7 @@ import positionService from "../../services/positionService";
17
const schema = yup.object().shape({
18
email: yup
19
.string()
20
- .email()
+ .email("Invalid email address")
21
.required("Email is required")
22
.test({
23
name: "checkDuplicateEmail",
@@ -26,7 +26,9 @@ const schema = yup.object().shape({
26
test: async (value, { parent }) => {
27
if (value) {
28
const result = await staffService.validateEmail(value, parent["id"]);
29
- return !(result.data as never)["exists"];
+ if (result.status === 200) {
30
+ return !(result.data as never)["exists"];
31
+ }
32
}
33
return true;
34
},
0 commit comments