From 993ecf4cf8917e171b768733a8c1076fe03264cc Mon Sep 17 00:00:00 2001 From: hannathkadher Date: Wed, 5 Feb 2025 11:30:40 +0400 Subject: [PATCH] fixed the unlinking --- src/space/services/space.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/space/services/space.service.ts b/src/space/services/space.service.ts index b575ab6..0815525 100644 --- a/src/space/services/space.service.ts +++ b/src/space/services/space.service.ts @@ -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(