- Removed the grocery item check box for all other profile types besides parent

- Allowed for all profile types to create new todos
This commit is contained in:
Dejan
2024-10-28 20:26:44 +01:00
parent 45747747dd
commit c234a6260a
2 changed files with 4 additions and 6 deletions

View File

@ -129,7 +129,7 @@ const GroceryItem = ({
</>} </>}
</View> </View>
) : ( ) : (
!isEditingTitle && ( !isEditingTitle && isParent && (
<Checkbox <Checkbox
value={item.bought} value={item.bought}
containerStyle={[styles.checkbox, {borderRadius: 50}]} containerStyle={[styles.checkbox, {borderRadius: 50}]}

View File

@ -1,5 +1,5 @@
import { useQuery } from "react-query"; import { useQuery } from "react-query";
import firestore from "@react-native-firebase/firestore"; import firestore, {or, query, where} from "@react-native-firebase/firestore";
import { ProfileType, useAuthContext } from "@/contexts/AuthContext"; import { ProfileType, useAuthContext } from "@/contexts/AuthContext";
import { IToDo } from "@/hooks/firebase/types/todoData"; import { IToDo } from "@/hooks/firebase/types/todoData";
@ -17,10 +17,8 @@ export const useGetTodos = () => {
.where("familyId", "==", profileData?.familyId) .where("familyId", "==", profileData?.familyId)
.get(); .get();
} else { } else {
snapshot = await firestore() let todosQuery = query(firestore().collection("Todos"), or(where("assignees", "array-contains", user?.uid), where("creatorId", "==", user?.uid)));
.collection("Todos") snapshot = await todosQuery.get();
.where("assignees", "array-contains", user?.uid)
.get();
} }
return snapshot.docs.map((doc) => { return snapshot.docs.map((doc) => {