Skip to content

Commit

Permalink
feat(mrf be validation): enable mrf response validation hard block (#…
Browse files Browse the repository at this point in the history
…7963)

* feat: enable mrf response validation hard block

* feat: add route mapping for FieldValidationErrorV3
  • Loading branch information
kevin9foong authored Dec 2, 2024
1 parent 4b6bc1e commit 3ee6f8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -531,16 +531,13 @@ export const validateMultirespondentSubmission = async (
})
})
.andThen((previousResponses) => {
// TODO: (FRM-1688) Set to block after sure that validation logic works as expected.
validateMrfFieldResponses({
return validateMrfFieldResponses({
formId,
visibleFieldIds,
formFields: form_fields,
responses: req.body.responses,
previousResponses,
})

return ok(req.body.responses)
}),
)
},
Expand Down
2 changes: 2 additions & 0 deletions src/app/modules/submission/submission.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ import {
SubmissionSaveError,
UnsupportedSettingsError,
ValidateFieldError,
ValidateFieldErrorV3,
VirusScanFailedError,
} from './submission.errors'
import {
Expand Down Expand Up @@ -309,6 +310,7 @@ const errorMapper: MapRouteError = (
'Submission too large to be saved. Please reduce the size of your submission and try again.',
}
case ValidateFieldError:
case ValidateFieldErrorV3:
case DatabaseValidationError:
case InvalidFileExtensionError:
case AttachmentTooLargeError:
Expand Down

0 comments on commit 3ee6f8f

Please sign in to comment.