Merge pull request #293 from SyncrowIOT/remove-old-tag-flow-from-update-space

remove old tag flow
This commit is contained in:
hannathkadher
2025-03-10 11:55:28 +04:00
committed by GitHub

View File

@ -490,23 +490,16 @@ export class SpaceService {
}
const hasSubspace = updateSpaceDto.subspace?.length > 0;
const hasTags = updateSpaceDto.tags?.length > 0;
if (hasSubspace || hasTags) {
if (hasSubspace) {
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(
updateSpaceDto.tags,
updateSpaceDto.subspace,
);
await this.subSpaceService.modifySubSpace(
modifiedSubspaces,
updateSpaceDto.subspace,
queryRunner,
space,
projectUuid,
@ -514,18 +507,6 @@ export class SpaceService {
);
}
if (hasTags) {
const spaceTagsAfterMove = this.tagService.getSubspaceTagsToBeAdded(
updateSpaceDto.tags,
updateSpaceDto.subspace,
);
await this.tagService.modifyTags(
spaceTagsAfterMove,
queryRunner,
space,
);
}
if (updateSpaceDto.tags) {
await this.spaceProductAllocationService.updateSpaceProductAllocations(
updateSpaceDto.tags,