Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: should parse responses using the form def
Browse files Browse the repository at this point in the history
g-tejas committed Jul 25, 2024

Verified

This commit was signed with the committer’s verified signature.
addaleax Anna Henningsen
1 parent 8eeb2be commit 1762b25
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -141,8 +141,12 @@ const submitEncryptModeForm = async (
encryptedPayload

// This is because NRIC masking is done in the controller, but we parse the fields in the
// middleware for encrypt forms
const parsedResponses = new ParsedResponsesObject(req.body.responses)
// middleware for encrypt forms. Only being used for email notifications
// In the case of unwrapOr, the isVisible field will be stripped out
const parsedResponses = ParsedResponsesObject.parseResponses(
formDef,
req.body.responses,
).unwrapOr(new ParsedResponsesObject(req.body.responses))

// Checks if user is SPCP-authenticated before allowing submission
let userName

0 comments on commit 1762b25

Please sign in to comment.