Skip to content

Commit

Permalink
fix: remove verified prefix on blank verified fields (#1701)
Browse files Browse the repository at this point in the history
* fix(email): remove verified tag for blank fields

* docs: verified prefix should not be added if field is blank
  • Loading branch information
yong-jie authored Apr 22, 2021
1 parent ad597a7 commit 21449b8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,15 @@ const getMyInfoPrefix = (
/**
* Determines the prefix for a question based on whether it was verified
* by a user during form submission.
*
* Verified prefixes are not added for optional fields that are left blank.
* @param response
* @returns the prefix
*/
const getVerifiedPrefix = (response: ResponseFormattedForEmail): string => {
return response.isUserVerified ? VERIFIED_PREFIX : ''
const { answer, isUserVerified } = response
const isAnswerBlank = answer === ''
return isUserVerified && !isAnswerBlank ? VERIFIED_PREFIX : ''
}

/**
Expand Down

0 comments on commit 21449b8

Please sign in to comment.