diff --git a/src/api/middleware/validators/offer.js b/src/api/middleware/validators/offer.js index 2e6ee670..8c7d0507 100644 --- a/src/api/middleware/validators/offer.js +++ b/src/api/middleware/validators/offer.js @@ -85,14 +85,14 @@ export const create = useExpressValidators([ .if((value, { req }) => req.body.jobType !== "FREELANCE") .exists().withMessage(ValidationReasons.REQUIRED).bail() .isInt().withMessage(ValidationReasons.INT), - + body("jobMaxDuration", ValidationReasons.DEFAULT) .if((value, { req }) => req.body.jobType !== "FREELANCE") .exists().withMessage(ValidationReasons.REQUIRED).bail() .isInt().withMessage(ValidationReasons.INT).bail() .custom(jobMaxDurationGreaterOrEqualThanJobMinDuration), - + body("jobStartDate", ValidationReasons.DEFAULT) .optional() diff --git a/test/end-to-end/offer.js b/test/end-to-end/offer.js index a50d130a..ff2572c3 100644 --- a/test/end-to-end/offer.js +++ b/test/end-to-end/offer.js @@ -233,17 +233,6 @@ describe("Offer endpoint tests", () => { FieldValidatorTester.mustBeAfter("publishDate"); }); - describe("jobMinDuration", () => { - const FieldValidatorTester = BodyValidatorTester("jobMinDuration"); - FieldValidatorTester.mustBeNumber(); - }); - - describe("jobMaxDuration", () => { - const FieldValidatorTester = BodyValidatorTester("jobMaxDuration"); - FieldValidatorTester.mustBeNumber(); - FieldValidatorTester.mustBeGreaterThanOrEqualToField("jobMinDuration"); - }); - describe("jobStartDate", () => { const FieldValidatorTester = BodyValidatorTester("jobStartDate"); FieldValidatorTester.mustBeDate();