From 60c721484464b983bcdeb72a30571574fd8c07de Mon Sep 17 00:00:00 2001 From: Phan Anh Tuan Date: Fri, 1 Dec 2023 17:00:27 +0700 Subject: [PATCH] fix: get block in resultGroupBy (return array) --- src/common/constant.ts | 24 +++++++------------ .../horoscope-handler/handler.service.ts | 2 +- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/common/constant.ts b/src/common/constant.ts index d1f0d92d1..a28525865 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -372,6 +372,14 @@ export const SERVICE = { path: 'v1.Cw20ReindexingService.reindexing', }, }, + HoroscopeHandlerService: { + key: 'HoroscopeHandlerService', + path: 'v1.HoroscopeHandlerService', + getData: { + key: 'getData', + path: 'v1.HoroscopeHandlerService.getData', + }, + }, CrawlIBCIcs20Service: { key: 'CrawlIBCIcs20Service', name: 'v1.CrawlIBCIcs20Service', @@ -384,22 +392,6 @@ export const SERVICE = { path: 'v1.ServicesManager.HealthCheck', }, }, - HoroscopeHandlerService: { - key: 'HoroscopeHandlerService', - path: 'v1.HoroscopeHandlerService', - getData: { - key: 'getData', - path: 'v1.HoroscopeHandlerService.getData', - }, - }, - HoroscopeHandlerService: { - key: 'HoroscopeHandlerService', - path: 'v1.HoroscopeHandlerService', - getData: { - key: 'getData', - path: 'v1.HoroscopeHandlerService.getData', - }, - }, }, }; diff --git a/src/services/horoscope-handler/handler.service.ts b/src/services/horoscope-handler/handler.service.ts index 0033db107..01f0a18a9 100644 --- a/src/services/horoscope-handler/handler.service.ts +++ b/src/services/horoscope-handler/handler.service.ts @@ -100,7 +100,7 @@ export default class HoroscopeHandlerService extends BaseService { if (resultGroupBy[height][0] instanceof Block) { const block: any = resultGroupBy[height].filter( (e) => e instanceof Block - ); + )[0]; const eventBlocks = resultGroupBy[height].filter( (e) => e instanceof Event );