mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 07:38:10 +00:00
fix: notification mark as read
This commit is contained in:
@@ -13,8 +13,10 @@ import {
|
|||||||
Patch,
|
Patch,
|
||||||
Post,
|
Post,
|
||||||
Query,
|
Query,
|
||||||
|
UseGuards,
|
||||||
} from "@nestjs/common";
|
} from "@nestjs/common";
|
||||||
import { ApiOperation, ApiTags } from "@nestjs/swagger";
|
import { ApiBearerAuth, ApiOperation, ApiTags } from "@nestjs/swagger";
|
||||||
|
import { JwtGuard } from "@tria-plc/api-common/modules/auth/services/jwt.guard";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AuthUserPayload,
|
AuthUserPayload,
|
||||||
@@ -24,6 +26,8 @@ import { ListNotificationsQueryDto } from "./dto/list-notifications-query.dto";
|
|||||||
import { NotificationInboxService } from "./notification-inbox.service";
|
import { NotificationInboxService } from "./notification-inbox.service";
|
||||||
|
|
||||||
@ApiTags("notifications")
|
@ApiTags("notifications")
|
||||||
|
@ApiBearerAuth()
|
||||||
|
@UseGuards(JwtGuard)
|
||||||
@Controller("notifications")
|
@Controller("notifications")
|
||||||
export class NotificationInboxController {
|
export class NotificationInboxController {
|
||||||
constructor(private readonly service: NotificationInboxService) {}
|
constructor(private readonly service: NotificationInboxService) {}
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ import { WsAuthService } from "./ws-auth.service";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Server → client push for in-app notifications. Clients only *listen* (no
|
* Server → client push for in-app notifications. Clients only *listen* (no
|
||||||
* `@SubscribeMessage` handlers), so the global HTTP JwtGuard never applies here;
|
* `@SubscribeMessage` handlers), and `@UseGuards(JwtGuard)` on the REST
|
||||||
* the handshake is authenticated in `handleConnection` and each socket joins a
|
* controller does not cover WebSockets; the handshake is authenticated in
|
||||||
* private `user:<id>` room the service targets.
|
* `handleConnection` and each socket joins a private `user:<id>` room the
|
||||||
|
* service targets.
|
||||||
*/
|
*/
|
||||||
@WebSocketGateway({
|
@WebSocketGateway({
|
||||||
namespace: NOTIFICATION_WS_NAMESPACE,
|
namespace: NOTIFICATION_WS_NAMESPACE,
|
||||||
|
|||||||
Reference in New Issue
Block a user