File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ function getServiceBaseUrl(config: Config) {
3030 ) ;
3131}
3232
33+ function getFileName ( path : string , file : StrapiFile ) {
34+ return `${ trimParam ( path ) } /${ file . hash } ${ file . ext } ` ;
35+ }
36+
3337function makeBlobServiceClient ( config : Config ) {
3438 const account = trimParam ( config . account ) ;
3539 const accountKey = trimParam ( config . accountKey ) ;
@@ -52,9 +56,7 @@ async function handleUpload(
5256) : Promise < void > {
5357 const serviceBaseURL = getServiceBaseUrl ( config ) ;
5458 const containerClient = blobSvcClient . getContainerClient ( trimParam ( config . containerName ) ) ;
55- const client = containerClient . getBlockBlobClient (
56- `${ trimParam ( config . defaultPath ) } /${ file . hash } `
57- ) ;
59+ const client = containerClient . getBlockBlobClient ( getFileName ( config . defaultPath , file ) ) ;
5860 const options = {
5961 blobHTTPHeaders : { blobContentType : file . mime } ,
6062 } ;
@@ -76,7 +78,7 @@ async function handleDelete(
7678 file : StrapiFile
7779) : Promise < void > {
7880 const containerClient = blobSvcClient . getContainerClient ( trimParam ( config . containerName ) ) ;
79- const client = containerClient . getBlobClient ( ` ${ trimParam ( config . defaultPath ) } / ${ file . hash } ` ) ;
81+ const client = containerClient . getBlobClient ( getFileName ( config . defaultPath , file ) ) ;
8082 await client . delete ( ) ;
8183 file . url = client . url ;
8284}
You can’t perform that action at this time.
0 commit comments