mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 08:54:54 +00:00
added endpoint to link
This commit is contained in:
@ -14,6 +14,7 @@ import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { SpaceModelService } from '../services';
|
||||
import {
|
||||
CreateSpaceModelDto,
|
||||
LinkSpacesToModelDto,
|
||||
SpaceModelParam,
|
||||
UpdateSpaceModelDto,
|
||||
} from '../dtos';
|
||||
@ -107,4 +108,20 @@ export class SpaceModelController {
|
||||
async delete(@Param() param: SpaceModelParam): Promise<BaseResponseDto> {
|
||||
return await this.spaceModelService.deleteSpaceModel(param);
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(PermissionsGuard)
|
||||
@Permissions('SPACE_MODEL_LINK')
|
||||
@ApiOperation({
|
||||
summary: ControllerRoute.SPACE_MODEL.ACTIONS.DELETE_SPACE_MODEL_SUMMARY,
|
||||
description:
|
||||
ControllerRoute.SPACE_MODEL.ACTIONS.DELETE_SPACE_MODEL_DESCRIPTION,
|
||||
})
|
||||
@Post(':spaceModelUuid/spaces/link')
|
||||
async link(
|
||||
@Param() params: SpaceModelParam,
|
||||
@Body() dto: LinkSpacesToModelDto,
|
||||
): Promise<BaseResponseDto> {
|
||||
return await this.spaceModelService.linkSpaceModel(params, dto);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user