add get group by id api

This commit is contained in:
faris Aljohari
2024-03-12 15:03:06 +03:00
parent b5eab2c858
commit db7802776a
4 changed files with 61 additions and 32 deletions
+13 -7
View File
@@ -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()