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 = [
113113 } ) . then ( ( _newAttachment ) => {
114114 newAttachment = _newAttachment . get ( { plain : true } ) ;
115115 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' ) {
117117 // retrieve download url for the response
118118 req . log . debug ( 'retrieving download url' ) ;
119119 return httpClient . post ( `${ fileServiceUrl } downloadurl` , {
@@ -124,7 +124,7 @@ module.exports = [
124124 }
125125 return Promise . resolve ( ) ;
126126 } ) . then ( ( resp ) => {
127- if ( process . env . NODE_ENV !== 'development' ) {
127+ if ( process . env . NODE_ENV !== 'development' || config . get ( 'enableFileUpload' ) === 'true' ) {
128128 req . log . debug ( 'Retreiving Presigned Url resp: ' , JSON . stringify ( resp . data ) ) ;
129129 return new Promise ( ( accept , reject ) => {
130130 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';
55import {
66 middleware as tcMiddleware ,
77} from 'tc-core-library-js' ;
8+ import config from 'config' ;
89import models from '../../models' ;
910import fileService from '../../services/fileService' ;
1011import { EVENT } from '../../constants' ;
@@ -41,7 +42,7 @@ module.exports = [
4142 . then ( ( ) => _attachment . destroy ( ) ) ;
4243 } ) )
4344 . then ( ( _attachment ) => {
44- if ( process . env . NODE_ENV !== 'development' ) {
45+ if ( process . env . NODE_ENV !== 'development' || config . get ( 'enableFileUpload' ) === 'true' ) {
4546 return fileService . deleteFile ( req , _attachment . filePath ) ;
4647 }
4748 return Promise . resolve ( ) ;
You can’t perform that action at this time.
0 commit comments