- Replaced explicit null/undefined/empty string checks with truthy/falsy conditions

- Improved code readability and efficiency
This commit is contained in:
hannathkadher
2025-02-04 18:57:15 +04:00
parent 9d72ad3717
commit 18b419f1dd
2 changed files with 3 additions and 3 deletions

View File

@ -44,8 +44,8 @@ export class TagModelService {
); );
} }
const tagEntitiesToCreate = tags.filter((tagDto) => tagDto.uuid === null); const tagEntitiesToCreate = tags.filter((tagDto) => !tagDto.uuid);
const tagEntitiesToUpdate = tags.filter((tagDto) => tagDto.uuid !== null); const tagEntitiesToUpdate = tags.filter((tagDto) => !!tagDto.uuid);
try { try {
const createdTags = await this.bulkSaveTags( const createdTags = await this.bulkSaveTags(

View File

@ -33,7 +33,7 @@ export class TagService {
this.ensureNoDuplicateTags(combinedTags); this.ensureNoDuplicateTags(combinedTags);
const tagEntitiesToCreate = tags.filter((tagDto) => !tagDto.uuid); const tagEntitiesToCreate = tags.filter((tagDto) => !tagDto.uuid);
const tagEntitiesToUpdate = tags.filter((tagDto) => tagDto.uuid !== null); const tagEntitiesToUpdate = tags.filter((tagDto) => !!tagDto.uuid);
try { try {
const createdTags = await this.bulkSaveTags( const createdTags = await this.bulkSaveTags(