const admin = require("firebase-admin");
admin.initializeApp();
...
exports.deleteTranscriptMedia = functions.firestore
.document("transcripts/{transcriptId}")
.onDelete(async (snap, context) => {
const defaultStorage = admin.storage();
const deletedValue = snap.data();
const storageRefPath = deletedValue.storageRef;
const bucket = defaultStorage.bucket();
// const file = bucket.file('profilePicture/' + userID + '.png');
const file = bucket.file(storageRefPath);
// Delete the file
return file.delete()
});