mirror of
https://github.com/AtHeartEngineering/bandada.git
synced 2026-01-10 00:48:41 -05:00
refactor(api): exclude the admins controller from the api docs instead of each endpoint separately
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user