Skip to content

Commit d6a1fe0

Browse files
committed
fix: use nullish coalescing instead of OR
1 parent 7d30378 commit d6a1fe0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

backend/src/record/record.service.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,9 @@ export class RecordService {
214214

215215
const updatedRecord = await recordRepo.save({
216216
id,
217-
description:
218-
description === '' ? '' : description || originalRecord.description,
217+
description: description ?? originalRecord.description,
219218
value: Number.isNaN(value) ? originalRecord.value : value,
220-
timestamp: timestamp || originalRecord.timestamp,
219+
timestamp: timestamp ?? originalRecord.timestamp,
221220
ownerUsername: username,
222221
walletId: walletOfRecord.id,
223222
categoryId: categoryOfRecord.id,

0 commit comments

Comments
 (0)