refactor(api): exclude the admins controller from the api docs instead of each endpoint separately

This commit is contained in:
Vivian Plasencia
2024-03-30 23:12:12 +01:00
parent b4b7eea56b
commit be90c45ab3

View File

@@ -1,23 +1,22 @@
import { Body, Controller, Get, Param, Put, UseGuards } from "@nestjs/common"
import { ApiExcludeEndpoint } from "@nestjs/swagger"
import { ApiExcludeController } from "@nestjs/swagger"
import { AuthGuard } from "../auth/auth.guard"
import { AdminsService } from "./admins.service"
import { UpdateApiKeyDTO } from "./dto/update-apikey.dto"
@ApiExcludeController()
@Controller("admins")
export class AdminsController {
constructor(private readonly adminsService: AdminsService) {}
@Get(":admin")
@UseGuards(AuthGuard)
@ApiExcludeEndpoint()
async getAdmin(@Param("admin") adminId: string) {
return this.adminsService.findOne({ id: adminId })
}
@Put(":admin/apikey")
@UseGuards(AuthGuard)
@ApiExcludeEndpoint()
async updateApiKey(
@Param("admin") adminId: string,
@Body() dto: UpdateApiKeyDTO