Skip to content

Commit

Permalink
PRIME-2788 fix email error (#2589)
Browse files Browse the repository at this point in the history
* initial commit

* fix other page
  • Loading branch information
bergomi02 authored Sep 16, 2024
1 parent 9db273f commit 49a63c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export class NextStepsComponent extends BaseEnrolmentProfilePage implements OnIn

let emailPairs = this.careSettingConfigs.map((config) => {
return {
emails: config.formArray.value.map(email => email.email),
emails: config.formArray.value.map(email => email.email).filter(e => e),
careSettingCode: config.settingCode,
healthAuthorityCode: config.settingCode === CareSettingEnum.HEALTH_AUTHORITY ? config.healthAuthorityCode : null,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class PharmanetEnrolmentSummaryComponent extends BaseEnrolmentPage implem
if (result) {
let emailPairs = this.careSettingConfigs.map((config) => {
return {
emails: config.formArray.value.map(email => email.email),
emails: config.formArray.value.map(email => email.email).filter(e => e),
careSettingCode: config.settingCode,
healthAuthorityCode: config.healthAuthorityCode,
}
Expand All @@ -227,8 +227,8 @@ export class PharmanetEnrolmentSummaryComponent extends BaseEnrolmentPage implem
.subscribe(() => {
let emails = new Array<string>();
this.careSettingConfigs.forEach((config) => {
if (config.formArray.value[0].email) {
emails.push(config.formArray.value.map(email => email.email));
if (config.formArray.value.map(email => email.email).filter(e => e)[0]) {
emails.push(config.formArray.value.map(email => email.email).filter(e => e));
}
});
this.toastService.openSuccessToast(`Email was successfully sent to ${emails.join(", ")}`);
Expand Down

0 comments on commit 49a63c9

Please sign in to comment.