Skip to content

Commit

Permalink
fix: use nullish coalescing instead of OR
Browse files Browse the repository at this point in the history
  • Loading branch information
proohit committed Jun 3, 2023
1 parent 7d30378 commit d6a1fe0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/src/record/record.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,9 @@ export class RecordService {

const updatedRecord = await recordRepo.save({
id,
description:
description === '' ? '' : description || originalRecord.description,
description: description ?? originalRecord.description,
value: Number.isNaN(value) ? originalRecord.value : value,
timestamp: timestamp || originalRecord.timestamp,
timestamp: timestamp ?? originalRecord.timestamp,
ownerUsername: username,
walletId: walletOfRecord.id,
categoryId: categoryOfRecord.id,
Expand Down

0 comments on commit d6a1fe0

Please sign in to comment.