Updated event conclusion message handling to ensure it is saved as null if not filled out, consistent with description field.

This commit is contained in:
Ryderjj89
2025-05-26 15:53:51 -04:00
parent cd9e43ee5a
commit edd3903ffb

View File

@@ -222,7 +222,7 @@ app.post('/api/events', upload.single('wallpaper'), async (req: MulterRequest, r
emailNotificationsEnabled ? 1 : 0, emailNotificationsEnabled ? 1 : 0,
email_recipients || '', email_recipients || '',
eventConclusionEmailEnabled ? 1 : 0, // Save new field eventConclusionEmailEnabled ? 1 : 0, // Save new field
event_conclusion_message || '' // Save new field event_conclusion_message === undefined ? null : event_conclusion_message // Save new field
] ]
); );
@@ -994,4 +994,4 @@ app.listen(port, async () => {
await connectToDatabase(); await connectToDatabase();
// Optionally run the task on startup for testing // Optionally run the task on startup for testing
// sendConclusionEmails(); // sendConclusionEmails();
}); });