File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,13 @@ const dagCBOR = require('ipld-dag-cbor')
5
5
const promisify = require ( 'promisify-es6' )
6
6
const CID = require ( 'cids' )
7
7
const multihash = require ( 'multihashes' )
8
+ const SendOneFile = require ( '../utils/send-one-file' )
8
9
9
10
function noop ( ) { }
10
11
11
12
module . exports = ( send ) => {
13
+ const sendOneFile = SendOneFile ( send , 'dag/put' )
14
+
12
15
return promisify ( ( dagNode , options , callback ) => {
13
16
if ( typeof options === 'function' ) {
14
17
return setImmediate ( ( ) => callback ( new Error ( 'no options were passed' ) ) )
@@ -44,16 +47,14 @@ module.exports = (send) => {
44
47
45
48
function finalize ( err , serialized ) {
46
49
if ( err ) { return callback ( err ) }
47
-
48
- send ( {
49
- path : 'dag/put' ,
50
+ const sendOptions = {
50
51
qs : {
51
52
hash : hashAlg ,
52
53
format : format ,
53
54
'input-enc' : inputEnc
54
- } ,
55
- files : serialized
56
- } , ( err , result ) => {
55
+ }
56
+ }
57
+ sendOneFile ( serialized , sendOptions , ( err , result ) => {
57
58
if ( err ) {
58
59
return callback ( err )
59
60
}
You can’t perform that action at this time.
0 commit comments