Skip to content

Commit

Permalink
Fix document dao invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
pshenmic committed Oct 12, 2023
1 parent 565eb69 commit 98ebaee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/api/src/controllers/MainController.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const BlocksDAO = require('../dao/BlocksDAO')
const DataContractsDAO = require('../dao/DataContractsDAO')
const TransactionsDAO = require('../dao/TransactionsDAO')
const DocumentsDAO = require('../dao/DocumentsDAO')

class MainController {
constructor(knex) {
this.blocksDAO = new BlocksDAO(knex)
this.dataContractsDAO = new DataContractsDAO(knex)
this.documentsDAO = new DocumentsDAO(knex)
this.transactionsDAO = new TransactionsDAO(knex)
}

Expand Down Expand Up @@ -64,7 +66,7 @@ class MainController {
return response.send({dataContract})
}
// search block by height
const document = await this.dataContractsDAO.getDataContractByIdentifier(query)
const document = await this.documentsDAO.getDocumentByIdentifier(query)

if (document) {
return response.send({document})
Expand Down

0 comments on commit 98ebaee

Please sign in to comment.