mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 18:56:22 +00:00
- Replaced explicit null/undefined/empty string checks with truthy/falsy conditions
- Improved code readability and efficiency
This commit is contained in:
@ -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(
|
||||||
|
@ -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(
|
||||||
|
Reference in New Issue
Block a user