mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 16:47:55 +00:00
add get group by id api
This commit is contained in:
@@ -27,18 +27,24 @@ export class GroupController {
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':homeId')
|
||||
async userList(
|
||||
@Param('homeId') homeId: string,
|
||||
@Query() getGroupsDto: GetGroupDto,
|
||||
) {
|
||||
@Get()
|
||||
async getGroupsByHomeId(@Query() getGroupsDto: GetGroupDto) {
|
||||
try {
|
||||
return await this.groupService.getGroupsByHomeId(homeId, getGroupsDto);
|
||||
return await this.groupService.getGroupsByHomeId(getGroupsDto);
|
||||
} catch (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':groupId')
|
||||
async getGroupsByGroupId(@Param('groupId') groupId: number) {
|
||||
try {
|
||||
return await this.groupService.getGroupsByGroupId(groupId);
|
||||
} catch (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post()
|
||||
|
||||
Reference in New Issue
Block a user