Merge pull request #250 from SyncrowIOT:bugfix/unlink-space-model

fixed the unlinking
This commit is contained in:
hannathkadher
2025-02-05 11:31:33 +04:00
committed by GitHub

View File

@ -388,15 +388,15 @@ export class SpaceService {
this.updateSpaceProperties(space, updateSpaceDto);
await queryRunner.manager.save(space);
const hasSubspace = updateSpaceDto.subspace?.length > 0;
const hasTags = updateSpaceDto.tags?.length > 0;
if (hasSubspace || hasTags) {
space.spaceModel = null;
await this.tagService.unlinkModels(space.tags, queryRunner);
await this.subSpaceService.unlinkModels(space.subspaces, queryRunner);
}
await queryRunner.manager.save(space);
if (hasSubspace) {
const modifiedSubspaces = this.tagService.getModifiedSubspaces(