fix: the bug in transaction list user side

This commit is contained in:
mahyargdz
2025-03-01 11:32:39 +03:30
parent 6aee1a5769
commit ada9c153e6
14 changed files with 84 additions and 153 deletions
@@ -99,8 +99,15 @@ export class NotificationsService {
//************************ */
async countUserNotifications(userId: string) {
const notificationCount = await this.notificationRepository.count({ where: { recipient: { id: userId }, isRead: false } });
return notificationCount;
}
//************************ */
async markAllAsRead(userId: string) {
await this.notificationRepository.update({ recipient: { id: userId } }, { isRead: true });
await this.notificationRepository.delete({ recipient: { id: userId } });
return {
message: CommonMessage.UPDATE_SUCCESS,
};