chore: get announcements by service
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Body, Controller, Get, Post, Query } from "@nestjs/common";
|
||||
import { Body, Controller, Get, Param, Post, Query } from "@nestjs/common";
|
||||
import { ApiProperty, ApiTags } from "@nestjs/swagger";
|
||||
|
||||
import { AnnouncementService } from "./announcement.service";
|
||||
@@ -41,4 +41,13 @@ export class AnnouncementController {
|
||||
async getPublicAnnouncements() {
|
||||
return await this.announcementService.getPublicAnnouncements();
|
||||
}
|
||||
|
||||
@AuthGuards()
|
||||
@ApiProperty({
|
||||
description: "Get all public announcements",
|
||||
})
|
||||
@Get(":serviceId")
|
||||
async getAnnouncementsByService(@Query() queryDto: SearchCriticismQueryDto, @Param("serviceId") serviceId: string) {
|
||||
return await this.announcementService.getAnnouncementByService(queryDto, serviceId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user