Update worship approval logic: Modify the import process to set the approval status based on the UI checkbox, ensuring a fallback to false if no value is provided. This enhances the clarity of the approval mechanism during worship data imports.

This commit is contained in:
Torsten Schulz (local)
2026-04-08 09:57:10 +02:00
parent 18d7c7f164
commit e6f87184b2

View File

@@ -1192,8 +1192,9 @@ exports.saveImportedWorships = async (req, res) => {
continue; // Überspringe vergangene Daten
}
// approved auf false setzen
worshipData.approved = false;
// Freigabe-Status aus Import-Dialog übernehmen (Checkbox in der UI).
// Fallback: wenn kein Wert gesetzt ist, bleibt es false.
worshipData.approved = !!worshipData.approved;
// Prüfen ob bereits ein Eintrag für dieses Datum und diese Uhrzeit existiert
const whereClause = {