mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 16:34:54 +00:00
- FIxed an issue with completing todos
This commit is contained in:
@ -13,12 +13,12 @@ export const useUpdateTodo = () => {
|
|||||||
mutationKey: ["updateTodo"],
|
mutationKey: ["updateTodo"],
|
||||||
mutationFn: async (todoData: Partial<IToDo>) => {
|
mutationFn: async (todoData: Partial<IToDo>) => {
|
||||||
try {
|
try {
|
||||||
|
if (todoData.connectedTodoId) {
|
||||||
|
console.log("CONNECTED")
|
||||||
const snapshot = await firestore()
|
const snapshot = await firestore()
|
||||||
.collection("Todos")
|
.collection("Todos")
|
||||||
.where("connectedTodoId", "==", todoData.connectedTodoId)
|
.where("connectedTodoId", "==", todoData.connectedTodoId)
|
||||||
.get();
|
.get();
|
||||||
|
|
||||||
if (todoData.connectedTodoId) {
|
|
||||||
const connectedTodos = snapshot.docs.map((doc) => {
|
const connectedTodos = snapshot.docs.map((doc) => {
|
||||||
const data = doc.data();
|
const data = doc.data();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user