-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(notification-service): update method to fetch user id for notification user #111
Conversation
…ication user RD-0
@@ -188,7 +191,7 @@ export class NotificationController { | |||
return notif.receiver.to.map(to => { | |||
const notifUser = new NotificationUser(); | |||
notifUser.notificationId = notif.id ?? ''; | |||
notifUser.userId = to.id; | |||
notifUser.userId = this.notifUserService.getUserId(to); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets move this out of loop. and make this async because this may contain DB hits further. it should take receiver as parameter and return a promise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am planning to send an extra key to the 'receiver.to' which will be used as 'userId'.
@@ -8,6 +9,10 @@ export interface IChannelManager { | |||
): boolean; | |||
} | |||
|
|||
export interface INotificationUserManager { | |||
getNotifUsers(notif: Notification): NotificationUser[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should return Promise<NotificationUser[]>
BREAKING CHANGE: RD-0 Y
0d398f8
to
286be4e
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description
update method to fetch user id for notification user.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: