We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9af7f53 commit 8533d1cCopy full SHA for 8533d1c
1 file changed
src/notification/infrastructure/repositories/notification.repository.ts
@@ -12,7 +12,15 @@ export class NotificationRepository implements INotificationRepository {
12
private readonly notificationModel: Model<NotificationDocument>,
13
) {}
14
findById(id: string): Promise<Notification | null> {
15
- throw new Error(`Method not implemented. ID: ${id}`);
+ return this.notificationModel
16
+ .findById(id)
17
+ .exec()
18
+ .then((doc) => {
19
+ if (!doc) {
20
+ return null;
21
+ }
22
+ return this.toEntity(doc);
23
+ });
24
}
25
26
async findAll(skip: number, limit: number): Promise<Notification[]> {
0 commit comments