File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,20 @@ export default class FirebaseStorageAdapter extends BaseAdapter {
3333 return filesExists [ 0 ] ;
3434 }
3535
36+ async save ( image : Image ) : Promise < string > {
3637 const targetDirectory = this . getTargetDir ( this . basePath ) ;
3738 // the typings are wrong here, getUniqueFileName returns a promise of a string
3839 const pathToSave = await this . getUniqueFileName ( image , targetDirectory ) ;
39- return this . bucket
40- . upload ( image . path , {
41- ...( this . uploadOptions ? { ...this . uploadOptions } : { } ) ,
40+ const defaultUploadOptions = {
41+ metadata : {
42+ cacheControl : `public, max-age=${ 30000 } ` ,
43+ } ,
44+ public : true ,
45+ } ;
46+ const uploadOptions = {
47+ ...( this . uploadOptions ? this . uploadOptions : defaultUploadOptions ) ,
4248 destination : pathToSave . split ( sep ) . join ( posix . sep ) ,
43- } )
44- . then ( ( ) => pathToSave ) ;
49+ } ;
4550 }
4651
4752 serve ( ) {
You can’t perform that action at this time.
0 commit comments