【发布时间】:2020-10-22 20:13:57
【问题描述】:
如何通过 url 从 Firebase 存储中删除图像? 当我从集合中删除项目(类别)时,图像仍保留在存储中。
接口类别:
export interface ICategory {
readonly id : string
name : string
image : string
}
删除函数
export const removeCategoryFB = (id: string, setCategories: any) => {
firestore()
.collection("categories")
.doc(id)
.delete()
.then(() => {
getCategoriesFB(setCategories);
})
.catch((err) => {
alert(err);
});
};
【问题讨论】:
-
firestore()处的数据库要参考
标签: typescript firebase google-cloud-firestore