mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 21:27:55 +00:00
finished rename group api
This commit is contained in:
@@ -7,12 +7,14 @@ import {
|
||||
UseGuards,
|
||||
Query,
|
||||
Param,
|
||||
Put,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from '../../../libs/common/src/guards/jwt.auth.guard';
|
||||
import { AddGroupDto } from '../dtos/add.group.dto';
|
||||
import { GetGroupDto } from '../dtos/get.group.dto';
|
||||
import { ControlGroupDto } from '../dtos/control.group.dto';
|
||||
import { RenameGroupDto } from '../dtos/rename.group.dto copy';
|
||||
|
||||
@ApiTags('Group Module')
|
||||
@Controller({
|
||||
@@ -57,4 +59,15 @@ export class GroupController {
|
||||
throw new Error(err);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Put('rename')
|
||||
async renameGroup(@Body() renameGroupDto: RenameGroupDto) {
|
||||
try {
|
||||
return await this.groupService.renameGroup(renameGroupDto);
|
||||
} catch (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user