Skip to content

Commit

Permalink
fix(app): address sonarcloud issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Demwunz committed Feb 15, 2024
1 parent cd8647b commit 1316424
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/validators/return-requirements/setup.validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ const VALID_VALUES = [
* any errors are found the `error:` property will also exist detailing what the issues were
*/
function go (data) {
const errorMessage = 'Select how you want to set up the return requirement'
const schema = Joi.object({
reason: Joi.string()
.required()
.valid(...VALID_VALUES)
.messages({
'any.required': 'Select how you want to set up the return requirement',
'any.only': 'Select how you want to set up the return requirement',
'string.empty': 'Select how you want to set up the return requirement'
'any.required': errorMessage,
'any.only': errorMessage,
'string.empty': errorMessage
})
})

Expand Down

0 comments on commit 1316424

Please sign in to comment.