mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 19:24:54 +00:00
added edit space module endpoint
This commit is contained in:
@ -5,12 +5,17 @@ import {
|
||||
Get,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { SpaceModelService } from '../services';
|
||||
import { CreateSpaceModelDto } from '../dtos';
|
||||
import {
|
||||
CreateSpaceModelDto,
|
||||
SpaceModelParam,
|
||||
UpdateSpaceModelDto,
|
||||
} from '../dtos';
|
||||
import { ProjectParam } from 'src/community/dtos';
|
||||
import { BaseResponseDto } from '@app/common/dto/base.response.dto';
|
||||
import { PermissionsGuard } from 'src/guards/permissions.guard';
|
||||
@ -59,4 +64,20 @@ export class SpaceModelController {
|
||||
): Promise<BaseResponseDto> {
|
||||
return await this.spaceModelService.list(projectParam, query);
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(PermissionsGuard)
|
||||
@Permissions('SPACE_MODEL_UPDATE')
|
||||
@ApiOperation({
|
||||
summary: ControllerRoute.SPACE_MODEL.ACTIONS.UPDATE_SPACE_MODEL_SUMMARY,
|
||||
description:
|
||||
ControllerRoute.SPACE_MODEL.ACTIONS.UPDATE_SPACE_MODEL_DESCRIPTION,
|
||||
})
|
||||
@Put(':spaceModelUuid')
|
||||
async update(
|
||||
@Body() dto: UpdateSpaceModelDto,
|
||||
@Param() param: SpaceModelParam,
|
||||
): Promise<BaseResponseDto> {
|
||||
return await this.spaceModelService.update(dto, param);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user