Open
Conversation
fa65459 to
fd682b3
Compare
Contributor
Author
I have resolved the conflicts. @willypelz |
willypelz
reviewed
Apr 11, 2025
| "@nestjs/mongoose": "^10.0.1", | ||
| "@nestjs/passport": "^10.0.2", | ||
| "@nestjs/platform-express": "^10.0.0", | ||
| "@nestjs/schedule": "^4.1.1", |
Member
There was a problem hiding this comment.
@DennisTemoye why do we have the nestjs/schedule brought into the code?
Member
|
This PR is having some conflicts @DennisTemoye can you fix this and would be good to be merged.
|
Tonykaynoni
reviewed
May 22, 2025
Comment on lines
+331
to
+376
| async createNotification( | ||
| message: string, | ||
| link: string, | ||
| userIds: string[], | ||
| roles: string[], | ||
| ): Promise<Notification> { | ||
| const notification = new this.notificationModel({ | ||
| message, | ||
| link, | ||
| userIds, | ||
| roles, | ||
| }); | ||
| return await notification.save(); | ||
| } | ||
|
|
||
| async getNotifications( | ||
| userIds?: string[], | ||
| roles?: string[], | ||
| ): Promise<Notification[]> { | ||
| const query: any = { | ||
| $or: [], | ||
| }; | ||
|
|
||
| // If userIds are provided, add them to the query | ||
| if (userIds && userIds.length > 0) { | ||
| query.$or.push({ userIds: { $in: userIds } }); | ||
| } | ||
|
|
||
| // If roles are provided, add them to the query | ||
| if (roles && roles.length > 0) { | ||
| query.$or.push({ roles: { $in: roles } }); | ||
| } | ||
|
|
||
| // If no filters are provided, return an empty array or all notifications as needed | ||
| if (query.$or.length === 0) { | ||
| return []; // or return await this.notificationModel.find().lean().exec(); to fetch all | ||
| } | ||
|
|
||
| return await this.notificationModel.find(query).lean().exec(); | ||
| } | ||
|
|
||
| async markAsRead(notificationId: string): Promise<Notification> { | ||
| return await this.notificationModel | ||
| .findByIdAndUpdate(notificationId, { isRead: true }, { new: true }) | ||
| .lean() | ||
| .exec(); |
Member
There was a problem hiding this comment.
This PR title says modify the backend documentation, it might make sense to move this change to a separate PR or add some description on the PR on these changes and add unit test. Nicely done.
Member
|
@DennisTemoye any update on this PR |
Member
|
@DennisTemoye, this issue remains unresolved.(Conflicts with the main branch) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I modified the backend documentation by removing the nestjs template from the documentation.