mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-23 09:07:54 +00:00
prettier
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user