File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ module.exports = [
113
113
} ) . then ( ( _newAttachment ) => {
114
114
newAttachment = _newAttachment . get ( { plain : true } ) ;
115
115
req . log . debug ( 'New Attachment record: ' , newAttachment ) ;
116
- if ( process . env . NODE_ENV !== 'development' ) {
116
+ if ( process . env . NODE_ENV !== 'development' || config . get ( 'enableFileUpload' ) === 'true' ) {
117
117
// retrieve download url for the response
118
118
req . log . debug ( 'retrieving download url' ) ;
119
119
return httpClient . post ( `${ fileServiceUrl } downloadurl` , {
@@ -124,7 +124,7 @@ module.exports = [
124
124
}
125
125
return Promise . resolve ( ) ;
126
126
} ) . then ( ( resp ) => {
127
- if ( process . env . NODE_ENV !== 'development' ) {
127
+ if ( process . env . NODE_ENV !== 'development' || config . get ( 'enableFileUpload' ) === 'true' ) {
128
128
req . log . debug ( 'Retreiving Presigned Url resp: ' , JSON . stringify ( resp . data ) ) ;
129
129
return new Promise ( ( accept , reject ) => {
130
130
if ( resp . status !== 200 || resp . data . result . status !== 200 ) {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import _ from 'lodash';
5
5
import {
6
6
middleware as tcMiddleware ,
7
7
} from 'tc-core-library-js' ;
8
+ import config from 'config' ;
8
9
import models from '../../models' ;
9
10
import fileService from '../../services/fileService' ;
10
11
import { EVENT } from '../../constants' ;
@@ -41,7 +42,7 @@ module.exports = [
41
42
. then ( ( ) => _attachment . destroy ( ) ) ;
42
43
} ) )
43
44
. then ( ( _attachment ) => {
44
- if ( process . env . NODE_ENV !== 'development' ) {
45
+ if ( process . env . NODE_ENV !== 'development' || config . get ( 'enableFileUpload' ) === 'true' ) {
45
46
return fileService . deleteFile ( req , _attachment . filePath ) ;
46
47
}
47
48
return Promise . resolve ( ) ;
You can’t perform that action at this time.
0 commit comments