mirror of
https://bitbucket.org/tagfer_team/tagfer-server.git
synced 2025-12-25 03:37:38 +00:00
T-954157790482076: Replace vars with const
This commit is contained in:
parent
b50fe3e951
commit
e87a5afba9
@ -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;
|
||||
|
||||
@ -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',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user