From 0f7727134724da880e5aa156f3fe73ca502c0135 Mon Sep 17 00:00:00 2001 From: Moe Elsharif Date: Sat, 4 Nov 2017 07:45:05 +0100 Subject: [PATCH 1/2] add flags to files/add --- src/files/add.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/files/add.js b/src/files/add.js index 324a49416..67431249f 100644 --- a/src/files/add.js +++ b/src/files/add.js @@ -41,6 +41,12 @@ module.exports = (send) => { } else if (opts.hashAlg != null) { qs.hash = opts.hashAlg } + if (opts["only-hash"] != null) { + qs["only-hash"] = opts["only-hash"]; + } + if (opts.pin != null) { + qs.pin = opts.pin; + } const request = { path: 'add', files: files, qs: qs, progress: opts.progress } From 8d0ad90928953a7cdb33de3a557279f25121578b Mon Sep 17 00:00:00 2001 From: Moe Elsharif Date: Sat, 4 Nov 2017 16:38:37 +0100 Subject: [PATCH 2/2] Linter fixes --- src/files/add.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/files/add.js b/src/files/add.js index 67431249f..215a7be12 100644 --- a/src/files/add.js +++ b/src/files/add.js @@ -41,11 +41,11 @@ module.exports = (send) => { } else if (opts.hashAlg != null) { qs.hash = opts.hashAlg } - if (opts["only-hash"] != null) { - qs["only-hash"] = opts["only-hash"]; + if (opts['only-hash'] != null) { + qs['only-hash'] = opts['only-hash'] } if (opts.pin != null) { - qs.pin = opts.pin; + qs.pin = opts.pin } const request = { path: 'add', files: files, qs: qs, progress: opts.progress }