File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -180,19 +180,18 @@ class S3Adapter {
180180 }
181181 await this . createBucket ( ) ;
182182 const command = new PutObjectCommand ( params ) ;
183- const response = await this . _s3Client . send ( command ) ;
183+ await this . _s3Client . send ( command ) ;
184184 const endpoint = this . _endpoint || `https://${ this . _bucket } .s3.${ this . _region } .amazonaws.com` ;
185185 const location = `${ endpoint } /${ params . Key } ` ;
186186
187187 let url ;
188- if ( config && typeof config === 'object' && Object . keys ( config ) . length > 0 ) { // if config is passed, we can generate a presigned url here
188+ if ( config ?. mount && config ?. applicationId ) { // if config has required properties for getFileLocation
189189 url = await this . getFileLocation ( config , key_without_prefix ) ;
190190 }
191191
192192 return {
193193 location : location , // actual upload location, used for tests
194194 name : key_without_prefix , // filename in storage, consistent with other adapters
195- s3_response : response , // raw s3 response
196195 ...url ? { url : url } : { } // url (optionally presigned) or non-direct access url
197196 } ;
198197 }
Original file line number Diff line number Diff line change @@ -897,7 +897,6 @@ describe('S3Adapter tests', () => {
897897 expect ( result ) . toEqual ( {
898898 location : jasmine . any ( String ) ,
899899 name : 'file.txt' ,
900- s3_response : jasmine . any ( Object ) ,
901900 url : 'https://presigned-url.com/file.txt'
902901 } ) ;
903902 } ) ;
@@ -914,7 +913,7 @@ describe('S3Adapter tests', () => {
914913
915914 await expectAsync (
916915 s3 . createFile ( 'file.txt' , 'hello world' , 'text/utf8' , { } )
917- ) . toBeRejectedWithError ( 'Generate key failed' ) ;
916+ ) . toBeRejectedWith ( 'Generate key failed' ) ;
918917 } ) ;
919918 } ) ;
920919
You can’t perform that action at this time.
0 commit comments