From 46c7db957e2d4b228168eb36a4d0a57490a45e60 Mon Sep 17 00:00:00 2001 From: Andrey Date: Fri, 28 Dec 2018 17:59:23 +0300 Subject: [PATCH] search --- src/cyber/Cyber.js | 5 ++--- src/redux/rootRegistry.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cyber/Cyber.js b/src/cyber/Cyber.js index d2a7a34..153fe9c 100644 --- a/src/cyber/Cyber.js +++ b/src/cyber/Cyber.js @@ -49,7 +49,6 @@ function Cyber(nodeUrl, ipfs) { self.search = function (text) { return new Promise((resolve) => { - saveInIPFS(ipfs, text) .then(cid => axios({ method: 'get', @@ -57,11 +56,11 @@ function Cyber(nodeUrl, ipfs) { })).then((data) => { const cids = data.data.result.cids; - const links = cids.map(cid => ({ ...cid, hash: cid.Cid })); + const links = cids.map(cid => ({ ...cid, hash: cid.rank })); const itemsPromises = links.map(item => { return Promise.all([ - getIPFS(ipfs, item.Cid), + getIPFS(ipfs, item.cid), Promise.resolve(item) ]).then(([content, _item]) => { return { diff --git a/src/redux/rootRegistry.js b/src/redux/rootRegistry.js index df4126f..89dcc86 100644 --- a/src/redux/rootRegistry.js +++ b/src/redux/rootRegistry.js @@ -7,7 +7,7 @@ const initState = { protocol: 'ipfs', }, cyber: { - hash: 'QmWzAybSUkAcnRdD7gz61pmeSGt8XJYyz4jq6bCc4u8bEB', + hash: 'QmcEd3zrfsRRx44HLZ6QJcAW1uLsq3fiBLNE9zsu5WX9s4', protocol: 'ipfs', }, wiki: {