mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 16:34:54 +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>
|
</View>
|
||||||
) : (
|
) : (
|
||||||
!isEditingTitle && (
|
!isEditingTitle && isParent && (
|
||||||
<Checkbox
|
<Checkbox
|
||||||
value={item.bought}
|
value={item.bought}
|
||||||
containerStyle={[styles.checkbox, {borderRadius: 50}]}
|
containerStyle={[styles.checkbox, {borderRadius: 50}]}
|
||||||
|
|||||||
@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user