Skip to content

Commit

Permalink
Issue #7: Issue #7: Refactor input validation code
Browse files Browse the repository at this point in the history
Fixed bug with undefined provincial health card validator
  • Loading branch information
marta- committed Oct 19, 2020
1 parent 9ebff55 commit 63113bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guids-generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
// Validate Health card number
let validateHealthCard = (value, province, dob) => {
// Use the province specific validator if available, otherwise default to the generic one
return HC_VALIDATOR[province](value, dob) || HC_VALIDATOR['CA'](value);
return (HC_VALIDATOR[province] || HC_VALIDATOR['CA'])(value, dob);
}

// For any line check previously enered lines that contains a <health card, province> pair
Expand Down

0 comments on commit 63113bc

Please sign in to comment.