mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-17 03:05:13 +00:00
fixed the unlinking
This commit is contained in:
@ -388,15 +388,15 @@ export class SpaceService {
|
|||||||
|
|
||||||
this.updateSpaceProperties(space, updateSpaceDto);
|
this.updateSpaceProperties(space, updateSpaceDto);
|
||||||
|
|
||||||
await queryRunner.manager.save(space);
|
|
||||||
|
|
||||||
const hasSubspace = updateSpaceDto.subspace?.length > 0;
|
const hasSubspace = updateSpaceDto.subspace?.length > 0;
|
||||||
const hasTags = updateSpaceDto.tags?.length > 0;
|
const hasTags = updateSpaceDto.tags?.length > 0;
|
||||||
|
|
||||||
if (hasSubspace || hasTags) {
|
if (hasSubspace || hasTags) {
|
||||||
|
space.spaceModel = null;
|
||||||
await this.tagService.unlinkModels(space.tags, queryRunner);
|
await this.tagService.unlinkModels(space.tags, queryRunner);
|
||||||
await this.subSpaceService.unlinkModels(space.subspaces, queryRunner);
|
await this.subSpaceService.unlinkModels(space.subspaces, queryRunner);
|
||||||
}
|
}
|
||||||
|
await queryRunner.manager.save(space);
|
||||||
|
|
||||||
if (hasSubspace) {
|
if (hasSubspace) {
|
||||||
const modifiedSubspaces = this.tagService.getModifiedSubspaces(
|
const modifiedSubspaces = this.tagService.getModifiedSubspaces(
|
||||||
|
Reference in New Issue
Block a user