mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-23 09:27:55 +00:00
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:
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user