mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 16:54:54 +00:00
updated space endpoint to follow project
This commit is contained in:
@ -12,7 +12,7 @@ import {
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard';
|
||||
import { AddSpaceDto, CommunitySpaceParam } from '../dtos';
|
||||
import { AddSpaceDto, CommunitySpaceParam, UpdateSpaceDto } from '../dtos';
|
||||
import { BaseResponseDto } from '@app/common/dto/base.response.dto';
|
||||
import { GetSpaceParam } from '../dtos/get.space.param';
|
||||
|
||||
@ -37,7 +37,7 @@ export class SpaceController {
|
||||
): Promise<BaseResponseDto> {
|
||||
return await this.spaceService.createSpace(
|
||||
addSpaceDto,
|
||||
communitySpaceParam.communityUuid,
|
||||
communitySpaceParam,
|
||||
);
|
||||
}
|
||||
|
||||
@ -51,11 +51,9 @@ export class SpaceController {
|
||||
})
|
||||
@Get()
|
||||
async getHierarchy(
|
||||
@Param() param: CommunitySpaceParam,
|
||||
@Param() params: CommunitySpaceParam,
|
||||
): Promise<BaseResponseDto> {
|
||||
return this.spaceService.getSpacesHierarchyForCommunity(
|
||||
param.communityUuid,
|
||||
);
|
||||
return this.spaceService.getSpacesHierarchyForCommunity(params);
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@ -66,7 +64,7 @@ export class SpaceController {
|
||||
})
|
||||
@Delete('/:spaceUuid')
|
||||
async deleteSpace(@Param() params: GetSpaceParam): Promise<BaseResponseDto> {
|
||||
return this.spaceService.delete(params.spaceUuid, params.communityUuid);
|
||||
return this.spaceService.delete(params);
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@ -78,13 +76,9 @@ export class SpaceController {
|
||||
})
|
||||
async updateSpace(
|
||||
@Param() params: GetSpaceParam,
|
||||
@Body() updateSpaceDto: AddSpaceDto,
|
||||
@Body() updateSpaceDto: UpdateSpaceDto,
|
||||
): Promise<BaseResponseDto> {
|
||||
return this.spaceService.updateSpace(
|
||||
params.spaceUuid,
|
||||
params.communityUuid,
|
||||
updateSpaceDto,
|
||||
);
|
||||
return this.spaceService.updateSpace(params, updateSpaceDto);
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@ -95,7 +89,7 @@ export class SpaceController {
|
||||
})
|
||||
@Get('/:spaceUuid')
|
||||
async get(@Param() params: GetSpaceParam): Promise<BaseResponseDto> {
|
||||
return this.spaceService.findOne(params.spaceUuid);
|
||||
return this.spaceService.findOne(params);
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@ -108,7 +102,7 @@ export class SpaceController {
|
||||
async getHierarchyUnderSpace(
|
||||
@Param() params: GetSpaceParam,
|
||||
): Promise<BaseResponseDto> {
|
||||
return this.spaceService.getSpacesHierarchyForSpace(params.spaceUuid);
|
||||
return this.spaceService.getSpacesHierarchyForSpace(params);
|
||||
}
|
||||
|
||||
//should it be post?
|
||||
@ -123,6 +117,6 @@ export class SpaceController {
|
||||
async generateSpaceInvitationCode(
|
||||
@Param() params: GetSpaceParam,
|
||||
): Promise<BaseResponseDto> {
|
||||
return this.spaceService.getSpaceInvitationCode(params.spaceUuid);
|
||||
return this.spaceService.getSpaceInvitationCode(params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user