Skip to content

Commit

Permalink
fix: pin ls with multiple CIDs (ipfs#1184)
Browse files Browse the repository at this point in the history
Fixes `pin.ls` with multiple CIDs, which was inadvertently unsupported since it wasn't documented but was being tested for in js-ipfs CLI tests.

ipfs-inactive/interface-js-ipfs-core#563 adds a test and documents the feature.
  • Loading branch information
alanshaw committed Nov 27, 2019
1 parent cb39a69 commit 2f3763f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"cross-env": "^6.0.0",
"detect-node": "^2.0.4",
"go-ipfs-dep": "^0.4.22",
"interface-ipfs-core": "^0.122.0",
"interface-ipfs-core": "^0.123.0",
"ipfsd-ctl": "^0.47.1",
"ndjson": "^1.5.0",
"nock": "^11.4.0",
Expand Down
4 changes: 3 additions & 1 deletion src/pin/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ module.exports = configure(({ ky }) => {
path = null
}

path = path || []
path = Array.isArray(path) ? path : [path]
options = options || {}

const searchParams = new URLSearchParams(options.searchParams)
if (path) searchParams.set('arg', `${path}`)
path.forEach(p => searchParams.append('arg', `${p}`))
if (options.type) searchParams.set('type', options.type)

const { Keys } = await ky.post('pin/ls', {
Expand Down

0 comments on commit 2f3763f

Please sign in to comment.