I'm successfully using the generate-thumbnail cloud function. My code is correctly saving the resized image as 'thumb_', storing the resized image into the correct storage location, and writing the downloadURL to my realtime database.
The cloud function is saving the downloadURL to ref('images')
return admin.database().ref('images').push({path: fileUrl, thumbnail: thumbFileUrl});
My Questions:
1. How can i change the database reference to be dynamic so it will save the downloadURL to a path in the database based on the album the user selected to upload?
Something like:
return admin.database().ref('\albums\{albumId}').push({path: fileUrl, thumbnail: thumbFileUrl});
2. Can i pass the albumId from my client to my cloud function as a variable?