Skip to content

Commit 8533d1c

Browse files
committed
fix: correct the notifcation repo
1 parent 9af7f53 commit 8533d1c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/notification/infrastructure/repositories/notification.repository.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ export class NotificationRepository implements INotificationRepository {
1212
private readonly notificationModel: Model<NotificationDocument>,
1313
) {}
1414
findById(id: string): Promise<Notification | null> {
15-
throw new Error(`Method not implemented. ID: ${id}`);
15+
return this.notificationModel
16+
.findById(id)
17+
.exec()
18+
.then((doc) => {
19+
if (!doc) {
20+
return null;
21+
}
22+
return this.toEntity(doc);
23+
});
1624
}
1725

1826
async findAll(skip: number, limit: number): Promise<Notification[]> {

0 commit comments

Comments
 (0)