Skip to content

Commit

Permalink
Merge 355fc9b into 5f23988
Browse files Browse the repository at this point in the history
  • Loading branch information
christianalfoni committed Jun 29, 2017
2 parents 5f23988 + 355fc9b commit 854a238
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/node_modules/@cerebral/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default [
success: [],
error: [],
abort: [], // Optional
'${STATUS_CODE}': [] // Optionally any status code, ex. 404: []
[STATUS_CODE]: [] // Optionally any status code, ex. 404: []
}
]
```
Expand Down Expand Up @@ -184,7 +184,7 @@ export default [
success: [],
error: [],
abort: [], // Optional
'${STATUS_CODE}': [] // Optionally any status code, ex. 404: []
[STATUS_CODE]: [] // Optionally any status code, ex. 404: []
}
]
```
Expand Down Expand Up @@ -229,7 +229,7 @@ export default [
success: [],
error: [],
abort: [], // Optional
'${STATUS_CODE}': [] // Optionally any status code, ex. 404: []
[STATUS_CODE]: [] // Optionally any status code, ex. 404: []
}
]
```
Expand Down Expand Up @@ -271,7 +271,7 @@ export default [
success: [],
error: [],
abort: [], // Optional
'${STATUS_CODE}': [] // Optionally any status code, ex. 404: []
[STATUS_CODE]: [] // Optionally any status code, ex. 404: []
}
]
```
Expand Down Expand Up @@ -313,7 +313,7 @@ export default [
success: [],
error: [],
abort: [], // Optional
'${STATUS_CODE}': [] // Optionally any status code, ex. 404: []
[STATUS_CODE]: [] // Optionally any status code, ex. 404: []
}
]
```
Expand All @@ -338,7 +338,7 @@ function someDeleteAction ({http, props}) {
name: 'filename.png', // Default to "files"
data: {}, // Additional form data
headers: {},
onProgress(progress) {} // Upload progress
onProgress: 'some.signal.path' // Upload progress
})
}
```
Expand All @@ -355,12 +355,13 @@ export default [

// Alternatively with explicit paths
httpUploadFile('/uploads', props`file`, {
name: state`currentFileName`
name: state`currentFileName`,
onProgress: 'some.signal.path'
}), {
success: [],
error: [],
abort: [], // Optional
'${STATUS_CODE}': [] // Optionally any status code, ex. 404: []
[STATUS_CODE]: [] // Optionally any status code, ex. 404: []
}
]
```
Expand Down
3 changes: 3 additions & 0 deletions packages/node_modules/@cerebral/http/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ export default function HttpProviderFactory(passedOptions) {
},
uploadFile(url, files, options = {}) {
options.url = moduleOptions.baseUrl + url
options.onProgress = typeof options.onProgress === 'string'
? context.controller.getSignal(options.onProgress)
: options.onProgress

return new FileUpload(options).send(files)
},
Expand Down

0 comments on commit 854a238

Please sign in to comment.