Skip to content

Commit

Permalink
Merge pull request #1046 from gitmedha/realeaseChangesdec12
Browse files Browse the repository at this point in the history
trainer 2 validation
  • Loading branch information
rohit-sharma-medha authored Dec 12, 2024
2 parents 45190e4 + abb5b54 commit 04c3536
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/views/OperationsModule/OperationComponents/TotEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,7 @@ const TotEdit = (props) => {
"End date must be greater than or equal to start date"
);
}),
trainer_1: Yup.string().required("Trainer 1 is required"),
trainer_2: Yup.string()
.required("Trainer 2 is required")
.test("not-same", "Trainers must be different", function (trainer2) {
const trainer1 = this.resolve(Yup.ref("trainer_1"));
return trainer1 !== trainer2;
}),
email: Yup.string()
.email("Invalid email format")
.required("Email is required"),
trainer_1: Yup.string().required("Trainer 1 is required")
});

const deleteEntry = async () => {
Expand Down

0 comments on commit 04c3536

Please sign in to comment.