Skip to content

Commit 0decd66

Browse files
author
Lucas Araujo
committed
[DDW-991] Review: simplify check
1 parent 72dbd0d commit 0decd66

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/renderer/app/api/api.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,12 @@ export default class AdaApi {
465465
{},
466466
{
467467
order: order || 'descending',
468-
...(fromDate
469-
? { start: `${moment.utc(fromDate).format('YYYY-MM-DDTHH:mm:ss')}Z` }
470-
: {}),
471-
...(toDate
472-
? { end: `${moment.utc(toDate).format('YYYY-MM-DDTHH:mm:ss')}Z` }
473-
: {}),
468+
},
469+
!!fromDate && {
470+
start: `${moment.utc(fromDate).format('YYYY-MM-DDTHH:mm:ss')}Z`,
471+
},
472+
!!toDate && {
473+
end: `${moment.utc(toDate).format('YYYY-MM-DDTHH:mm:ss')}Z`,
474474
}
475475
);
476476

0 commit comments

Comments
 (0)