T-954157790482076: Replace vars with const

This commit is contained in:
Okechi Onyeje 2019-01-12 19:07:42 -05:00
parent b50fe3e951
commit e87a5afba9
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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',