diff --git a/functions/api/events-team/events/new.ts b/functions/api/events-team/events/new.ts index 8d63e4a..7c95962 100644 --- a/functions/api/events-team/events/new.ts +++ b/functions/api/events-team/events/new.ts @@ -76,6 +76,22 @@ export async function onRequestPost(context: RequestContext) { ) .run(); + await fetch(context.env.EVENTS_WEBHOOK, { + body: JSON.stringify({ + embeds: [ + { + title: "Event Submitted", + color: 3756250, + description: `${context.data.user.username} submitted an event for ${currentYear}-${currentMonth}-${day}. See it at https://carcrushers.cc/events-team`, + }, + ], + }), + headers: { + "content-type": "application/json", + }, + method: "POST", + }); + return new Response(null, { status: 204, });