fixed the unlinking

This commit is contained in:
hannathkadher
2025-02-05 11:30:40 +04:00
parent 2a4926f94e
commit 993ecf4cf8

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(