mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 20:49:42 +03:00
Added ban and unban to Swagger
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user