Skip to content

Commit

Permalink
Merge pull request #9 from poojakarma/change_Responses_and_DB_tables_…
Browse files Browse the repository at this point in the history
…names

change format for response of notification send
  • Loading branch information
vaivk369 authored Aug 29, 2024
2 parents 1393705 + 7521f96 commit 53d3768
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/modules/notification/notification.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,17 @@ export class NotificationService {
results.forEach((result, index) => {
const channel = ['email', 'sms', 'push'][index];
if (result.status === 'fulfilled') {
serverResponses[channel].data.push(result.value);
result.value.forEach(notification => {
if (notification.status === 200) {
serverResponses[channel].data.push(notification);
} else {
serverResponses[channel].errors.push({
recipient: notification.recipient,
error: notification.error || notification.result,
code: notification.status
});
}
});
} else {
serverResponses[channel].errors.push({
error: result.reason?.message,
Expand Down

0 comments on commit 53d3768

Please sign in to comment.