mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00
Merge pull request #293 from SyncrowIOT/remove-old-tag-flow-from-update-space
remove old tag flow
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user