- Implemented assigning todos

This commit is contained in:
Dejan
2024-10-20 20:45:09 +02:00
parent 206ffd5a88
commit 709b333ee1
6 changed files with 75 additions and 36 deletions

View File

@ -1,6 +1,8 @@
import { useQuery } from "react-query";
import firestore from "@react-native-firebase/firestore";
import { useAuthContext } from "@/contexts/AuthContext";
import {UserProfile} from "@/hooks/firebase/types/profileTypes";
import {IToDo} from "@/hooks/firebase/types/todoData";
export const useGetTodos = () => {
const { user, profileData } = useAuthContext();
@ -17,16 +19,11 @@ export const useGetTodos = () => {
const data = doc.data();
return {
...data,
id: doc.id,
title: data.title,
done: data.done,
date: data.date ? new Date(data.date.seconds * 1000) : null,
points: data.points,
rotate: data.points,
repeatType: data.repeatType,
creatorId: data.creatorId
};
});
}) as IToDo[];
}
})
};