Added ban and unban to Swagger

This commit is contained in:
2024-02-07 21:52:54 +03:00
parent 20d0335364
commit 5d477ca630

View File

@@ -1,4 +1,4 @@
import { Body, Controller, Post, Put, Param } from '@nestjs/common'; import { Body, Controller, Param, Post, Put } from '@nestjs/common';
import { ApiOperation, ApiTags } from '@nestjs/swagger'; import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { IGetUser } from './user.dto'; import { IGetUser } from './user.dto';
import { UserService } from './user.service'; import { UserService } from './user.service';
@@ -15,13 +15,20 @@ export class UserController {
async getUser(@Body() data: IGetUser) { async getUser(@Body() data: IGetUser) {
return await this.userService.getUser(data); return await this.userService.getUser(data);
} }
@ApiOperation({
description: 'Ban user by its telegram id',
})
@Put('ban/:id') @Put('ban/:id')
async banUser(@Param('id') id: string) { async banUser(@Param('id') id: string) {
return await this.userService.banUser(id); return await this.userService.banUser(id);
} }
@ApiOperation({
description: 'Unban user by its telegram id',
})
@Put('unBan/:id') @Put('unBan/:id')
async unBanUser(@Param('id') id: string) { async unBanUser(@Param('id') id: string) {
return await this.userService.unBanUser(id); return await this.userService.unBanUser(id);
} }
} }