Skip to content

Commit

Permalink
fix(AdminFormsRoutes): use Joi.object.and instead of object.with
Browse files Browse the repository at this point in the history
`with` allows for a query with only `endDate` since only `startDate` is required, which is wrong
  • Loading branch information
karrui committed Nov 16, 2020
1 parent a802e60 commit f2479ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/routes/admin-forms.server.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ module.exports = function (app) {
// Ensure YYYY-MM-DD format.
endDate: Joi.string().regex(YYYY_MM_DD_REGEX),
})
.with('startDate', 'endDate'),
.and('startDate', 'endDate'),
}),
withUserAuthentication,
AdminFormController.handleCountFormSubmissions,
Expand Down

0 comments on commit f2479ea

Please sign in to comment.