mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
25 lines
989 B
TypeScript
25 lines
989 B
TypeScript
import { Controller, Get, Param, Patch, UseGuards } from '@nestjs/common';
|
|
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
|
import { NotificationsService } from './notifications.service';
|
|
import { JwtGuard } from '../../common/jwt.guard';
|
|
|
|
@ApiTags('Notifications')
|
|
@Controller('notifications')
|
|
@UseGuards(JwtGuard)
|
|
@ApiBearerAuth('JWT-auth')
|
|
export class NotificationsController {
|
|
constructor(private service: NotificationsService) {}
|
|
|
|
@Get(':passengerId')
|
|
@ApiOperation({ summary: 'Get notifications for passenger' })
|
|
getForPassenger(@Param('passengerId') id: string) { return this.service.getForPassenger(id); }
|
|
|
|
@Patch(':id/read')
|
|
@ApiOperation({ summary: 'Mark notification as read' })
|
|
markRead(@Param('id') id: string) { return this.service.markRead(id); }
|
|
|
|
@Patch(':passengerId/read-all')
|
|
@ApiOperation({ summary: 'Mark all notifications as read' })
|
|
markAllRead(@Param('passengerId') id: string) { return this.service.markAllRead(id); }
|
|
}
|