Skip to content
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

Merged
merged 3 commits into from
Dec 30, 2020

Conversation

mayank-SFIN571
Copy link
Contributor

Description

update method to fetch user id for notification user.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Intermediate change (work in progress)

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

  • Test A
  • Test B

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Any dependent changes have been merged and published in downstream modules

@@ -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);
Copy link
Contributor

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.

Copy link
Contributor Author

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'.

@samarpan-b samarpan-b changed the title chore(notification-service): update method to fetch user id for notification user fix(notification-service): update method to fetch user id for notification user Dec 30, 2020
@@ -8,6 +9,10 @@ export interface IChannelManager {
): boolean;
}

export interface INotificationUserManager {
getNotifUsers(notif: Notification): NotificationUser[];
Copy link
Contributor

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[]>

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 30, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@samarpan-b samarpan-b merged commit 26246d7 into master Dec 30, 2020
@samarpan-b samarpan-b deleted the userid-fix branch December 30, 2020 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants