From ae6196913ec0fedee7272c621509193bf809cbf6 Mon Sep 17 00:00:00 2001 From: phamphong9981 Date: Fri, 23 Aug 2024 10:52:33 +0700 Subject: [PATCH] fix: cw721 statistic --- src/services/cw721/cw721.service.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/services/cw721/cw721.service.ts b/src/services/cw721/cw721.service.ts index 983b510b2..29e84390e 100644 --- a/src/services/cw721/cw721.service.ts +++ b/src/services/cw721/cw721.service.ts @@ -310,11 +310,13 @@ export default class Cw721HandlerService extends BullableService { .join(','); await knex.transaction(async (trx) => { if (newActDistinctByContract.length > 0) { - await knex - .raw( - `UPDATE cw721_contract SET no_holders = temp.no_holders from (VALUES ${stringListUpdates}) as temp(id, no_holders) where temp.id = cw721_contract.id` - ) - .transacting(trx); + if (stringListUpdates) { + await knex + .raw( + `UPDATE cw721_contract SET no_holders = temp.no_holders from (VALUES ${stringListUpdates}) as temp(id, no_holders) where temp.id = cw721_contract.id` + ) + .transacting(trx); + } await BlockCheckpoint.query() .transacting(trx) .insert({