Merge pull request #248 from SyncrowIOT:SP-1017-FE-Implement-Confirmation-Modal-for-Duplication-Action

Optimize tag filtering logic using falsy checks
This commit is contained in:
hannathkadher
2025-02-04 18:58:39 +04:00
committed by GitHub
2 changed files with 3 additions and 3 deletions
@@ -44,8 +44,8 @@ export class TagModelService {
);
}
const tagEntitiesToCreate = tags.filter((tagDto) => tagDto.uuid === null);
const tagEntitiesToUpdate = tags.filter((tagDto) => tagDto.uuid !== null);
const tagEntitiesToCreate = tags.filter((tagDto) => !tagDto.uuid);
const tagEntitiesToUpdate = tags.filter((tagDto) => !!tagDto.uuid);
try {
const createdTags = await this.bulkSaveTags(
+1 -1
View File
@@ -33,7 +33,7 @@ export class TagService {
this.ensureNoDuplicateTags(combinedTags);
const tagEntitiesToCreate = tags.filter((tagDto) => !tagDto.uuid);
const tagEntitiesToUpdate = tags.filter((tagDto) => tagDto.uuid !== null);
const tagEntitiesToUpdate = tags.filter((tagDto) => !!tagDto.uuid);
try {
const createdTags = await this.bulkSaveTags(