get space model by id

This commit is contained in:
hannathkadher
2025-01-08 21:34:59 +04:00
parent 5e31529f8b
commit 4744b0844c
3 changed files with 33 additions and 0 deletions
@@ -323,6 +323,22 @@ export class SpaceModelService {
}
}
async findOne(params: SpaceModelParam): Promise<BaseResponseDto> {
try {
await this.validateProject(params.projectUuid);
const spaceModel = await this.validateSpaceModel(params.spaceModelUuid);
return new SuccessResponseDto({
message: 'SpaceModel retrieved successfully',
data: spaceModel,
});
} catch (error) {
throw new HttpException(
`Failed to retrieve space model ${error}`,
HttpStatus.INTERNAL_SERVER_ERROR,
);
}
}
async validateSpaceModel(uuid: string): Promise<SpaceModelEntity> {
const spaceModel = await this.spaceModelRepository.findOne({
where: {