From 565eb6915dfe3baf584b9a606d59ca2b05181f3b Mon Sep 17 00:00:00 2001 From: pshenmic Date: Thu, 12 Oct 2023 23:28:25 +0700 Subject: [PATCH] Add document to the search query --- packages/api/src/controllers/MainController.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/api/src/controllers/MainController.js b/packages/api/src/controllers/MainController.js index 0bf1ad4f1..7f458cdac 100644 --- a/packages/api/src/controllers/MainController.js +++ b/packages/api/src/controllers/MainController.js @@ -63,6 +63,12 @@ class MainController { if (dataContract) { return response.send({dataContract}) } + // search block by height + const document = await this.dataContractsDAO.getDataContractByIdentifier(query) + + if (document) { + return response.send({document}) + } } response.status(404).send({message: 'not found'})