Skip to content

Commit

Permalink
update: swagger document
Browse files Browse the repository at this point in the history
  • Loading branch information
siwonpada committed Sep 2, 2024
1 parent 678f6fe commit 7745f38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client/client.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { DeleteClientDto } from './dto/req/deleteClient.dto';
import { ClientGuard } from './guard/client.guard';
import { GetClient } from './decorator/getClient.decorator';
import { Client } from '@prisma/client';
import { AuthorityDto } from './dto/req/authority.dto';

@ApiTags('client')
@Controller('client')
Expand Down Expand Up @@ -85,7 +86,7 @@ export class ClientController {
@UseGuards(ClientGuard)
async addAuthority(
@GetClient() client: Client,
@Body('authority') authority: string,
@Body() { authority }: AuthorityDto,
): Promise<void> {
await this.clientService.addAuthority(client.uuid, authority);
}
Expand All @@ -102,7 +103,7 @@ export class ClientController {
@UseGuards(ClientGuard)
async removeAuthority(
@GetClient() client: Client,
@Body('authority') authority: string,
@Body() { authority }: AuthorityDto,
): Promise<void> {
await this.clientService.removeAuthority(client.uuid, authority);
}
Expand Down
10 changes: 10 additions & 0 deletions src/client/dto/req/authority.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';

export class AuthorityDto {
@ApiProperty({
description: 'The authority to be added',
})
@IsString()
authority: string;
}

0 comments on commit 7745f38

Please sign in to comment.