From 78e7690f4c0301f5cc4f1d399cab0609e5639b4d Mon Sep 17 00:00:00 2001 From: Mario Sarcevic Date: Wed, 24 Apr 2024 15:12:01 +0200 Subject: [PATCH] fix: Prevent omni-search for (sometimes) returning wrong results when responing about hashes (I.E. only return aliasId if there was an alias output returned in the 'query check') --- api/src/utils/stardust/searchExecutor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/utils/stardust/searchExecutor.ts b/api/src/utils/stardust/searchExecutor.ts index 9b142557e..b61d16220 100644 --- a/api/src/utils/stardust/searchExecutor.ts +++ b/api/src/utils/stardust/searchExecutor.ts @@ -53,7 +53,7 @@ export class SearchExecutor { this.apiService .milestoneDetailsById(searchQuery.milestoneId) .then((milestoneDetails) => { - if (milestoneDetails) { + if (milestoneDetails.blockId) { promisesResult = { milestone: milestoneDetails, }; @@ -139,7 +139,7 @@ export class SearchExecutor { this.apiService .aliasDetails(searchQuery.aliasId) .then((aliasOutputs) => { - if (aliasOutputs) { + if (aliasOutputs.aliasDetails) { promisesResult = { aliasId: searchQuery.aliasId, did: searchQuery.did, @@ -162,7 +162,7 @@ export class SearchExecutor { this.apiService .nftDetails(searchQuery.nftId) .then((nftOutputs) => { - if (nftOutputs) { + if (nftOutputs.nftDetails) { promisesResult = { nftId: searchQuery.nftId, };