mirror of
https://github.com/urosran/cally.git
synced 2025-07-10 15:17:17 +00:00
fixes, deleteFamily function, household signup
This commit is contained in:
@ -1813,7 +1813,8 @@ exports.updateHouseholdTimestampOnEventUpdate = functions.firestore
|
||||
'BrainDumps',
|
||||
'Groceries',
|
||||
'Todos',
|
||||
'Events'
|
||||
'Events',
|
||||
//'Feedbacks'
|
||||
];
|
||||
|
||||
for (const collectionName of collections) {
|
||||
@ -1829,13 +1830,16 @@ exports.updateHouseholdTimestampOnEventUpdate = functions.firestore
|
||||
batch.delete(profile.ref);
|
||||
}
|
||||
|
||||
const householdDoc = await db.collection('Households')
|
||||
.doc(familyId)
|
||||
.get();
|
||||
|
||||
if (householdDoc.exists) {
|
||||
batch.delete(householdDoc.ref);
|
||||
}
|
||||
const householdSnapshot = await db.collection('Households')
|
||||
.where('familyId', '==', familyId)
|
||||
.get();
|
||||
|
||||
if (!householdSnapshot.empty) {
|
||||
const householdDoc = householdSnapshot.docs[0];
|
||||
batch.delete(householdDoc.ref);
|
||||
} else {
|
||||
console.log('Household not found for familyId:', familyId);
|
||||
}
|
||||
|
||||
await batch.commit();
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user