Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit b315c36

Browse files
author
Alan Shaw
committed
fix: support multiple paths in pin.add
1 parent dead1d3 commit b315c36

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pin/add.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ const CID = require('cids')
44
const configure = require('../lib/configure')
55

66
module.exports = configure(({ ky }) => {
7-
return async (path, options) => {
7+
return async (paths, options) => {
8+
paths = Array.isArray(paths) ? paths : [paths]
89
options = options || {}
910

1011
const searchParams = new URLSearchParams(options.searchParams)
11-
searchParams.set('arg', `${path}`)
12+
paths.forEach(path => searchParams.append('arg', `${path}`))
1213
if (options.recursive != null) searchParams.set('recursive', options.recursive)
1314

1415
const res = await ky.post('pin/add', {

0 commit comments

Comments
 (0)