File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -167,18 +167,14 @@ export class FilesRouter {
167
167
const bufferData = Buffer . from ( fileObject . file . _data , 'base64' ) ;
168
168
fileObject . fileSize = Buffer . byteLength ( bufferData ) ;
169
169
// prepare file options
170
- const fileTags = fileObject . file . _tags ;
171
- let fileOptions = {
170
+ const fileOptions = {
172
171
metadata : fileObject . file . _metadata ,
173
172
} ;
174
- if ( Object . keys ( fileTags ) . length > 0 ) {
175
- // some s3-compatible providers (DigitalOcean, Linode) do not accept tags
176
- // so we do not include the tags option if it is empty.
177
- fileOptions = {
178
- ...fileOptions ,
179
- tags : fileTags ,
180
- } ;
181
- }
173
+ // some s3-compatible providers (DigitalOcean, Linode) do not accept tags
174
+ // so we do not include the tags option if it is empty.
175
+ const fileTags =
176
+ Object . keys ( fileObject . file . _tags ) . length > 0 ? { tags : fileObject . file . _tags } : { } ;
177
+ Object . assign ( fileOptions , fileTags ) ;
182
178
// save file
183
179
const createFileResult = await filesController . createFile (
184
180
config ,
You can’t perform that action at this time.
0 commit comments