Skip to content

Commit

Permalink
fix: validation shift form
Browse files Browse the repository at this point in the history
  • Loading branch information
filipezaidan committed Oct 3, 2024
1 parent 4d1b567 commit ffb2ab1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function validateRequiredFields(data) {
phone,
email,
grade,
shift,
} = data;
let errors = [];
if (
Expand All @@ -20,7 +21,8 @@ function validateRequiredFields(data) {
!fatherName ||
!phone ||
!email ||
!grade
!grade ||
!shift
) {
errors.push({ msg: "Por favor, preencha todos os campos obrigatórios." });
}
Expand Down Expand Up @@ -78,6 +80,7 @@ function validateActivities(activities) {

function validateFormInput(data) {
let errors = [];
console.log({ data });
errors = errors.concat(
validateRequiredFields(data),
validateDate(data.day, data.month, data.year),
Expand Down

0 comments on commit ffb2ab1

Please sign in to comment.