Spaces:
Sleeping
Sleeping
Download backend/src/modules/notifications/notifications.controller.ts from kishankrish19/Chat: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/notifications/notifications.controller.ts
- Command line
-
hf download hf://spaces/kishankrish19/Chat/backend/src/modules/notifications/notifications.controller.ts
-
curl -L -o notifications.controller.ts https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/notifications/notifications.controller.ts
1.07 kB
| import { Controller, Get, Patch, Param, UseGuards, Req } from '@nestjs/common'; | |
| import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger'; | |
| import { NotificationsService } from './notifications.service'; | |
| import { JwtAuthGuard } from '../auth/jwt-auth.guard'; | |
| ('In-App Notifications') | |
| ('me/notifications') | |
| (JwtAuthGuard) | |
| () | |
| export class NotificationsController { | |
| constructor(private readonly notifService: NotificationsService) {} | |
| () | |
| ({ summary: 'Paginated list of user notifications' }) | |
| getNotifications(() req: any) { | |
| return this.notifService.getNotifications(req.user.userId); | |
| } | |
| ('read-all') | |
| ({ summary: 'Mark all notifications as read' }) | |
| markAllAsRead(() req: any) { | |
| return this.notifService.markAllAsRead(req.user.userId); | |
| } | |
| (':id/read') | |
| ({ summary: 'Mark single notification as read' }) | |
| markAsRead(() req: any, ('id') id: string) { | |
| return this.notifService.markAsRead(req.user.userId, id); | |
| } | |
| } | |