mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 10:44:55 +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 { SpaceModelService } from '../services';
|
||||||
import {
|
import {
|
||||||
CreateSpaceModelDto,
|
CreateSpaceModelDto,
|
||||||
|
LinkSpacesToModelDto,
|
||||||
SpaceModelParam,
|
SpaceModelParam,
|
||||||
UpdateSpaceModelDto,
|
UpdateSpaceModelDto,
|
||||||
} from '../dtos';
|
} from '../dtos';
|
||||||
@ -107,4 +108,20 @@ export class SpaceModelController {
|
|||||||
async delete(@Param() param: SpaceModelParam): Promise<BaseResponseDto> {
|
async delete(@Param() param: SpaceModelParam): Promise<BaseResponseDto> {
|
||||||
return await this.spaceModelService.deleteSpaceModel(param);
|
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