- Fixed an issue with missing id when creating events and unable to update after

This commit is contained in:
Dejan
2024-10-26 16:04:42 +02:00
parent c597e96c20
commit c25ddfcdf5

View File

@ -30,9 +30,10 @@ export const useCreateEvent = () => {
return;
}
}
const newDoc = firestore().collection('Events').doc();
await firestore()
.collection("Events")
.add({...eventData, creatorId: currentUser?.uid, familyId: profileData?.familyId});
.add({...eventData, id: newDoc.id, creatorId: currentUser?.uid, familyId: profileData?.familyId});
} catch (e) {
console.error(e);
}