Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit d2f6d10

Browse files
committed
Use core's object.data method for object data command
1 parent a320571 commit d2f6d10

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/cli/commands/object/data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ module.exports = Command.extend({
2020
}
2121

2222
const mh = new Buffer(bs58.decode(key))
23-
node.object.get(mh, (err, obj) => {
23+
node.object.data(mh, (err, data) => {
2424
if (err) {
2525
log.error(err)
2626
throw err
2727
}
2828

29-
console.log(obj.data.toString())
29+
console.log(data.toString())
3030
})
3131
}
3232
})

src/http-api/resources/object.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ exports.data = {
201201
handler: (request, reply) => {
202202
const key = request.pre.args.key
203203

204-
ipfs.object.get(key, (err, obj) => {
204+
ipfs.object.data(key, (err, data) => {
205205
if (err) {
206206
log.error(err)
207207
return reply({
@@ -210,7 +210,7 @@ exports.data = {
210210
}).code(500)
211211
}
212212

213-
return reply(obj.data.toString())
213+
return reply(data.toString())
214214
})
215215
}
216216
}

0 commit comments

Comments
 (0)