File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import Path from 'path';
11
11
import { middleware as tcMiddleware } from 'tc-core-library-js' ;
12
12
import models from '../../models' ;
13
13
import util from '../../util' ;
14
- import { getDownloadUrl } from '../../services/fileService'
14
+ import { getDownloadUrl } from '../../services/fileService' ;
15
15
import { EVENT , RESOURCES , ATTACHMENT_TYPES } from '../../constants' ;
16
16
17
17
const permissions = tcMiddleware . permissions ;
@@ -130,7 +130,7 @@ module.exports = [
130
130
if ( process . env . NODE_ENV !== 'development' || config . get ( 'enableFileUpload' ) === 'true' ) {
131
131
// retrieve download url for the response
132
132
req . log . debug ( 'retrieving download url' ) ;
133
- return getDownloadUrl ( destBucket , path )
133
+ return getDownloadUrl ( destBucket , path ) ;
134
134
}
135
135
return Promise . resolve ( ) ;
136
136
} ) . then ( ( url ) => {
@@ -152,7 +152,7 @@ module.exports = [
152
152
newAttachment ,
153
153
) ;
154
154
res . status ( 201 ) . json ( response ) ;
155
- accept ( ) ;
155
+ return Promise . resolve ( ) ;
156
156
}
157
157
let response = _ . cloneDeep ( newAttachment ) ;
158
158
response = _ . omit ( response , [ 'path' , 'deletedAt' ] ) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ const permissions = tcMiddleware.permissions;
16
16
/**
17
17
* This private function gets the pre-signed url if the attachment is a file
18
18
*
19
- * @param {Object } req The http request
20
19
* @param {Object } attachment The project attachment object
21
20
* @returns {Array<Promise> } The array of two promises, first one if the attachment object promise,
22
21
* The second promise is for the file pre-signed url (if attachment type is file)
@@ -33,7 +32,7 @@ const getPreSignedUrl = async (attachment) => {
33
32
return [ attachment , 'dummy://url' ] ;
34
33
}
35
34
// Not in development mode or file upload is not disabled
36
- const url = await getDownloadUrl ( config . get ( 'attachmentsS3Bucket' ) , attachment . path )
35
+ const url = await getDownloadUrl ( config . get ( 'attachmentsS3Bucket' ) , attachment . path ) ;
37
36
return [ attachment , url ] ;
38
37
} ;
39
38
You can’t perform that action at this time.
0 commit comments