From e87a5afba91518890cdfbb5152412b8a29aa319f Mon Sep 17 00:00:00 2001 From: Okechi Onyeje Date: Sat, 12 Jan 2019 19:07:42 -0500 Subject: [PATCH] T-954157790482076: Replace vars with const --- src/ups/profiles/dao.js | 2 +- src/ups/utils/utils.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ups/profiles/dao.js b/src/ups/profiles/dao.js index 877891d..77a78b5 100644 --- a/src/ups/profiles/dao.js +++ b/src/ups/profiles/dao.js @@ -47,7 +47,7 @@ function getProfile(profileNumber, tagferId) { async function updateProfileImage(profileImageData, profileNumber, tagferId) { //persist profile image data to firebase storage try { - var downloadURL = await utils.uploadImage(profileImageData, `${tagferId}-profile${profileNumber}`, appConfig.buckets.profile); + const downloadURL = await utils.uploadImage(profileImageData, `${tagferId}-profile${profileNumber}`, appConfig.buckets.profile); return { promise: database.ref(`/profiles/${tagferId}/profile${profileNumber}/photoURL`).set(downloadURL), imageURL: downloadURL }; } catch (error) { throw error; diff --git a/src/ups/utils/utils.js b/src/ups/utils/utils.js index ac6c1d0..ef2e512 100644 --- a/src/ups/utils/utils.js +++ b/src/ups/utils/utils.js @@ -83,8 +83,8 @@ async function uploadImage(imageData, path, bucketName) { try { const bucket = firebase.storage().bucket(`gs://${bucketName}`); - var file = bucket.file(`${path}.${appConfig.imageFormat[imageData.metaData.contentType]}`); - var imageBuffer = Buffer.from(imageData.base64Data, 'base64'); + const file = bucket.file(`${path}.${appConfig.imageFormat[imageData.metaData.contentType]}`); + const imageBuffer = Buffer.from(imageData.base64Data, 'base64'); await file.save(imageBuffer, { validation: 'md5',