2
0
forked from jmug/cactoide

fix: refactor, docker, dateformatter

This commit is contained in:
Levente Orban
2025-08-27 11:45:41 +02:00
parent c11060deab
commit 91209d9efc
11 changed files with 266 additions and 199 deletions

View File

@@ -117,15 +117,14 @@ export const actions: Actions = {
createdAt: new Date()
});
return { success: true };
return { success: true, type: 'add' };
} catch (err) {
console.error('Error adding RSVP:', err);
return fail(500, { error: 'Failed to add RSVP' });
}
},
removeRSVP: async ({ request, params }) => {
const eventId = params.id;
removeRSVP: async ({ request }) => {
const formData = await request.formData();
const rsvpId = formData.get('rsvpId') as string;
@@ -136,7 +135,7 @@ export const actions: Actions = {
try {
await drizzleQuery.delete(rsvps).where(eq(rsvps.id, rsvpId));
return { success: true };
return { success: true, type: 'remove' };
} catch (err) {
console.error('Error removing RSVP:', err);
return fail(500, { error: 'Failed to remove RSVP' });