-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(notifications): fix notifications delete and make-all-as-read com…
…mands
- Loading branch information
Showing
6 changed files
with
45 additions
and
9 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...pp/notifications/notification/commands/handlers/notifications-make-all-as-read.handler.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NotificationService } from '../../notification.service'; | ||
import { NotificationsMarkAllAsReadCommand } from '../notifications-make-all-as-read.command'; | ||
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'; | ||
|
||
@CommandHandler(NotificationsMarkAllAsReadCommand) | ||
export class NotificationsMarkAsReadHandler implements ICommandHandler<NotificationsMarkAllAsReadCommand> { | ||
constructor(private readonly notificationService: NotificationService) {} | ||
|
||
public async execute(command: NotificationsMarkAllAsReadCommand): Promise<void> { | ||
console.log('command:NotificationsMarkAllAsReadCommand', command); | ||
await this.notificationService.onMarkAllAsRead(command); | ||
} | ||
} |
This file contains 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
7 changes: 7 additions & 0 deletions
7
...api/src/app/notifications/notification/commands/notifications-make-all-as-read.command.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ICommand } from '@nestjs/cqrs'; | ||
import { User } from '@ngx-starter-kit/models'; | ||
|
||
export class NotificationsMarkAllAsReadCommand implements ICommand { | ||
static readonly type = '[Notifications] MarkAllAsRead'; | ||
constructor(public readonly payload: any, public readonly user: User) {} | ||
} |
This file contains 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
This file contains 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
This file contains 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