mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 08:24:55 +00:00
- 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:
@ -129,7 +129,7 @@ const GroceryItem = ({
|
||||
</>}
|
||||
</View>
|
||||
) : (
|
||||
!isEditingTitle && (
|
||||
!isEditingTitle && isParent && (
|
||||
<Checkbox
|
||||
value={item.bought}
|
||||
containerStyle={[styles.checkbox, {borderRadius: 50}]}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
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 { IToDo } from "@/hooks/firebase/types/todoData";
|
||||
|
||||
@ -17,10 +17,8 @@ export const useGetTodos = () => {
|
||||
.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) => {
|
||||
|
||||
Reference in New Issue
Block a user