Skip to content
This repository has been archived by the owner on Dec 19, 2020. It is now read-only.

Commit

Permalink
search
Browse files Browse the repository at this point in the history
  • Loading branch information
Pechalka committed Dec 28, 2018
1 parent 9dc727a commit 46c7db9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/cyber/Cyber.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,18 @@ function Cyber(nodeUrl, ipfs) {

self.search = function (text) {
return new Promise((resolve) => {

saveInIPFS(ipfs, text)
.then(cid => axios({
method: 'get',
url: `${nodeUrl}/search?cid=${cid}`,
})).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 {
Expand Down
2 changes: 1 addition & 1 deletion src/redux/rootRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const initState = {
protocol: 'ipfs',
},
cyber: {
hash: 'QmWzAybSUkAcnRdD7gz61pmeSGt8XJYyz4jq6bCc4u8bEB',
hash: 'QmcEd3zrfsRRx44HLZ6QJcAW1uLsq3fiBLNE9zsu5WX9s4',
protocol: 'ipfs',
},
wiki: {
Expand Down

0 comments on commit 46c7db9

Please sign in to comment.