updated group module

This commit is contained in:
hannathkadher
2024-11-04 20:57:32 +04:00
parent 6e2f3bb8b6
commit 0d000e4b60
3 changed files with 15 additions and 16 deletions
+6 -7
View File
@@ -2,7 +2,6 @@ import { GroupService } from '../services/group.service';
import { Controller, Get, UseGuards, Param, Req } from '@nestjs/common';
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard';
import { UnitPermissionGuard } from 'src/guards/unit.permission.guard';
import { EnableDisableStatusEnum } from '@app/common/constants/days.enum';
@ApiTags('Group Module')
@@ -17,21 +16,21 @@ export class GroupController {
@UseGuards(JwtAuthGuard)
@Get(':spaceUuid')
async getGroupsBySpaceUuid(@Param('spaceUuid') spaceUuid: string) {
return await this.groupService.getGroupsByUnitUuid(spaceUuid);
return await this.groupService.getGroupsBySpaceUuid(spaceUuid);
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Get(':unitUuid/devices/:groupName')
@Get(':spaceUuid/devices/:groupName')
async getUnitDevicesByGroupName(
@Param('unitUuid') unitUuid: string,
@Param('spaceUuid') spaceUuid: string,
@Param('groupName') groupName: string,
@Req() req: any,
) {
const userUuid = req.user.uuid;
return await this.groupService.getUnitDevicesByGroupName(
unitUuid,
return await this.groupService.getSpaceDevicesByGroupName(
spaceUuid,
groupName,
userUuid,
);