@@ -6,7 +6,7 @@ import azure from "azure-storage";
66import config from "../config" ;
77import { logger } from "../logger" ;
88
9- export function uploadImage ( imagePath , callback ) {
9+ export function uploadImage ( imagePath : string , callback ?: ( err : Error | null , url ?: string ) => void ) : void {
1010 if ( ! imagePath || typeof imagePath !== 'string' ) {
1111 callback ( new Error ( 'Image path is missing or wrong' ) , null )
1212 return
@@ -19,11 +19,11 @@ export function uploadImage(imagePath, callback) {
1919
2020 const azureBlobService = azure . createBlobService ( config . azure . connectionString )
2121
22- azureBlobService . createContainerIfNotExists ( config . azure . container , { publicAccessLevel : 'blob' } , function ( err , result , response ) {
22+ azureBlobService . createContainerIfNotExists ( config . azure . container , { publicAccessLevel : 'blob' } , function ( err ) {
2323 if ( err ) {
2424 callback ( new Error ( err . message ) , null )
2525 } else {
26- azureBlobService . createBlockBlobFromLocalFile ( config . azure . container , path . basename ( imagePath ) , imagePath , function ( err , result , response ) {
26+ azureBlobService . createBlockBlobFromLocalFile ( config . azure . container , path . basename ( imagePath ) , imagePath , function ( err , result ) {
2727 if ( err ) {
2828 callback ( new Error ( err . message ) , null )
2929 } else {
0 commit comments