| import { Controller, Get } from '@nestjs/common'; | |
| import { GetUserFromRequest } from '@gitroom/nestjs-libraries/user/user.from.request'; | |
| import { Organization, User } from '@prisma/client'; | |
| import { GetOrgFromRequest } from '@gitroom/nestjs-libraries/user/org.from.request'; | |
| import { NotificationService } from '@gitroom/nestjs-libraries/database/prisma/notifications/notification.service'; | |
| import { ApiTags } from '@nestjs/swagger'; | |
| ('Notifications') | |
| ('/notifications') | |
| export class NotificationsController { | |
| constructor(private _notificationsService: NotificationService) {} | |
| ('/') | |
| async mainPageList( | |
| () user: User, | |
| () organization: Organization | |
| ) { | |
| return this._notificationsService.getMainPageCount( | |
| organization.id, | |
| user.id | |
| ); | |
| } | |
| ('/list') | |
| async notifications( | |
| () user: User, | |
| () organization: Organization | |
| ) { | |
| return this._notificationsService.getNotifications( | |
| organization.id, | |
| user.id | |
| ); | |
| } | |
| } | |