Allow updating events

This commit is contained in:
Bruno Bernardino
2024-03-21 16:24:59 +00:00
parent f779dde0fc
commit 9cd5d9f43d
8 changed files with 388 additions and 7 deletions

View File

@@ -42,11 +42,10 @@ export const handler: Handlers<Data, FreshContextState> = {
const calendarEvent = await getCalendarEvent(
requestBody.calendarEventId,
requestBody.calendarId,
context.state.user.id,
);
if (!calendarEvent) {
if (!calendarEvent || requestBody.calendarId !== calendarEvent.calendar_id) {
return new Response('Not Found', { status: 404 });
}