File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,11 +15,7 @@ const THREE_HOURS = 1000 * 60 * 60 * 3;
1515 * @return {Promise }
1616 */
1717module . exports = function getDownloadURL ( opts ) {
18- const provider = this . provider ( 'download' , opts ) ;
19-
2018 const { uploadId, username } = opts ;
21- const { cname, expire } = provider ;
22-
2319 const key = `${ FILES_DATA } :${ uploadId } ` ;
2420
2521 return Promise
@@ -28,7 +24,9 @@ module.exports = function getDownloadURL(opts) {
2824 . then ( isProcessed )
2925 . then ( data => {
3026 // parse file data
27+ const provider = this . provider ( 'download' , data ) ;
3128 const { name, files } = data ;
29+ const { cname, expire } = provider ;
3230
3331 // check status and if we have public link available - use it
3432 let urls ;
@@ -46,6 +44,7 @@ module.exports = function getDownloadURL(opts) {
4644 hasAccess ( username ) ( data ) ;
4745
4846 // signed URL settings
47+
4948 const settings = {
5049 action : 'read' ,
5150 // 3 hours
Original file line number Diff line number Diff line change 11// this file contains logic for selecting transport for uploading
22// input is upload opts
3+ const is = require ( 'is' ) ;
34const findIndex = require ( 'lodash/findIndex' ) ;
45const { FILES_BUCKET_FIELD , FILES_TEMP_FIELD } = require ( '../constant.js' ) ;
56
@@ -45,7 +46,7 @@ const ACTION_TO_SELECTOR = {
4546// fn for selection
4647function selectTransport ( action , opts ) {
4748 const thunk = ACTION_TO_SELECTOR [ action ] ;
48- if ( ! thunk ) {
49+ if ( ! is . fn ( thunk ) ) {
4950 throw new Error ( `${ action } selector not defined` ) ;
5051 }
5152
You can’t perform that action at this time.
0 commit comments