From 96bf8ed7f8fa3041a5e30fe2b64940608e53af35 Mon Sep 17 00:00:00 2001 From: hannathkadher Date: Mon, 27 Jan 2025 12:54:46 +0400 Subject: [PATCH] prettier --- src/space-model/services/tag-model.service.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/space-model/services/tag-model.service.ts b/src/space-model/services/tag-model.service.ts index 0fb1942..0f77b3d 100644 --- a/src/space-model/services/tag-model.service.ts +++ b/src/space-model/services/tag-model.service.ts @@ -47,7 +47,6 @@ export class TagModelService { const tagEntitiesToCreate = tags.filter((tagDto) => tagDto.uuid === null); const tagEntitiesToUpdate = tags.filter((tagDto) => tagDto.uuid !== null); - try { const createdTags = await this.bulkSaveTags( tagEntitiesToCreate, @@ -137,7 +136,7 @@ export class TagModelService { HttpStatus.NOT_FOUND, ); } - + if (subspaceModel && subspaceModel.spaceModel) { await queryRunner.manager.update( this.tagModelRepository.target, @@ -278,7 +277,6 @@ export class TagModelService { productUuid: tag.productUuid as string, }; - const newModel = await this.createTags( [createTagDto], queryRunner, @@ -348,7 +346,6 @@ export class TagModelService { ], }); - // Remove tags that are marked for deletion const filteredTagExists = tagExists.filter( (existingTag) => @@ -357,7 +354,6 @@ export class TagModelService { ), ); - // If any tags remain, throw an exception if (filteredTagExists.length > 0) { throw new HttpException( @@ -365,7 +361,6 @@ export class TagModelService { HttpStatus.CONFLICT, ); } - } catch (error) { if (error instanceof HttpException) { throw error; @@ -487,20 +482,16 @@ export class TagModelService { subspaceModels: ModifySubspaceModelDto[], ): ModifyTagModelDto[] { if (!subspaceModels || subspaceModels.length === 0) { - return spaceTags; } - const spaceTagsToDelete = spaceTags.filter( (tag) => tag.action === 'delete', ); - const tagsToAdd = subspaceModels.flatMap( (subspace) => subspace.tags?.filter((tag) => tag.action === 'add') || [], ); - const commonTagUuids = new Set( tagsToAdd