Here's a function I am currently working with:
export async function onDeleteVideo(event: FirestoreEvent<QueryDocumentSnapshot, { uid: string }>): Promise<any> {
if (!event) {
return
}
const { disposables } = event.data.data()
for (const disposable of disposables) {
try {
await storage.bucket(disposable.bucket).file(disposable.object).delete()
} catch {}
}
}
This function is exported as:
export const onDeleteVideo = onDocumentDeleted('videos/{uid}', triggers.onDeleteVideo)
However, I am facing issues with event.data.data()
and disposables
as they are of any type. How can I include my custom interface named Video?