Skip to content

Commit 72dbd0d

Browse files
author
Lucas Araujo
committed
[DDW-991] Make sure start and end params are not undefined
1 parent 7a41f8d commit 72dbd0d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

source/renderer/app/api/api.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,18 +460,19 @@ export default class AdaApi {
460460
parameters: request,
461461
});
462462
const { walletId, order, fromDate, toDate, isLegacy } = request;
463+
463464
const params = Object.assign(
464465
{},
465466
{
466467
order: order || 'descending',
467-
start: undefined,
468-
end: undefined,
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+
: {}),
469474
}
470475
);
471-
if (fromDate)
472-
params.start = `${moment.utc(fromDate).format('YYYY-MM-DDTHH:mm:ss')}Z`;
473-
if (toDate)
474-
params.end = `${moment.utc(toDate).format('YYYY-MM-DDTHH:mm:ss')}Z`;
475476

476477
try {
477478
let response;

0 commit comments

Comments
 (0)