From 70f233574b912883880ca37818ccd2cba6607d0b Mon Sep 17 00:00:00 2001 From: phamphong9981 Date: Wed, 3 Jul 2024 10:57:23 +0700 Subject: [PATCH] refactor: review --- src/services/evm/erc20.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/evm/erc20.service.ts b/src/services/evm/erc20.service.ts index 25a0194eb..ab167f404 100644 --- a/src/services/evm/erc20.service.ts +++ b/src/services/evm/erc20.service.ts @@ -387,8 +387,8 @@ export default class Erc20Service extends BullableService { .first() .throwIfNotFound() ).time; - const lastUpdatedDate = (await Erc20Statistic.query().max('date').first()) - ?.max; + const lastUpdatedRecord = await Erc20Statistic.query().max('date').first(); + const lastUpdatedDate = lastUpdatedRecord?.max; if (lastUpdatedDate) { systemDate.setHours(0, 0, 0, 0); lastUpdatedDate.setHours(0, 0, 0, 0);