From 955b14ee611af2a42f1c85e18fde95da2820a89d Mon Sep 17 00:00:00 2001 From: moist-webDev Date: Wed, 21 Jun 2023 21:58:26 -0400 Subject: [PATCH] delete custom category and all its data --- routes/OtherCat.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routes/OtherCat.tsx b/routes/OtherCat.tsx index bb2cf39..31853fa 100644 --- a/routes/OtherCat.tsx +++ b/routes/OtherCat.tsx @@ -58,10 +58,11 @@ export default function OtherCat({theme, otherCategories, setOtherCategories, se } const handleDelete = async () => { - const res = await db.from('categories').delete().eq({id: newCat.id}); + let res = await db.from('categories').delete().eq({id: newCat.id}); if (res.data) { setOtherCategories([...otherCategories.filter((c:any) => c.id !== newCat.id)]) } + res = await db.from('others').delete().eq({category: newCat.id}) setModalVisible(false); setNewCat({title: '', showEpisodes: false}); setEditPop(false);