Finished first pass of event creation system

This commit is contained in:
2025-11-27 13:15:41 -05:00
parent e14ad7ad44
commit 941004f913
2 changed files with 2 additions and 2 deletions

View File

@@ -54,7 +54,6 @@ r.get('/:id', async (req: Request, res: Response) => {
let details: CalendarEvent = await getEventDetails(eventID); let details: CalendarEvent = await getEventDetails(eventID);
details.eventSignups = await getEventAttendance(eventID); details.eventSignups = await getEventAttendance(eventID);
console.log(details);
res.status(200).json(details); res.status(200).json(details);
} catch (err) { } catch (err) {
console.error('Insert failed:', err); console.error('Insert failed:', err);
@@ -68,6 +67,8 @@ r.post('/', async (req: Request, res: Response) => {
try { try {
const member = req.user.id; const member = req.user.id;
let event: CalendarEvent = req.body; let event: CalendarEvent = req.body;
event.start = new Date(event.start);
event.end = new Date(event.end);
console.log(event); console.log(event);
createEvent(event); createEvent(event);
res.sendStatus(200); res.sendStatus(200);

View File

@@ -26,7 +26,6 @@ export async function updateEvent(eventObject: CalendarEvent) {
if (!eventObject.id) { if (!eventObject.id) {
throw new Error("updateEvent: Missing event ID."); throw new Error("updateEvent: Missing event ID.");
} }
const sql = ` const sql = `
UPDATE calendar_events UPDATE calendar_events
SET SET