From c234a6260a33aaea5b813ffc7fa9086541390757 Mon Sep 17 00:00:00 2001 From: Dejan Date: Mon, 28 Oct 2024 20:26:44 +0100 Subject: [PATCH] - Removed the grocery item check box for all other profile types besides parent - Allowed for all profile types to create new todos --- components/pages/grocery/GroceryItem.tsx | 2 +- hooks/firebase/useGetTodos.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/pages/grocery/GroceryItem.tsx b/components/pages/grocery/GroceryItem.tsx index c1026bc..e521e44 100644 --- a/components/pages/grocery/GroceryItem.tsx +++ b/components/pages/grocery/GroceryItem.tsx @@ -129,7 +129,7 @@ const GroceryItem = ({ } ) : ( - !isEditingTitle && ( + !isEditingTitle && isParent && ( { .where("familyId", "==", profileData?.familyId) .get(); } else { - snapshot = await firestore() - .collection("Todos") - .where("assignees", "array-contains", user?.uid) - .get(); + let todosQuery = query(firestore().collection("Todos"), or(where("assignees", "array-contains", user?.uid), where("creatorId", "==", user?.uid))); + snapshot = await todosQuery.get(); } return snapshot.docs.map((doc) => {