remove old tag flow

This commit is contained in:
faris Aljohari
2025-03-10 10:42:00 +03:00
parent c6793a46a5
commit c8d72a90b6

View File

@ -520,23 +520,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,
@ -544,18 +537,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,