Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Actually store event details (oops)
  • Loading branch information
regalijan committed Feb 26, 2024
1 parent 9554240 commit f1fa3c8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions app/routes/events-team.tsx
Expand Up @@ -150,6 +150,20 @@ export default function () {
{event.type.toUpperCase()}
</Text>
</Box>
<Box>
<Heading size="sm">Event Details</Heading>
<Text fontSize="sm" pt="2">
{event.details}
</Text>
</Box>
{event.type === "rotw" ? (
<Box>
<Heading size="sm">RIDDLE ANSWER</Heading>
<Text fontSize="sm" pt="2">
{event.answer}
</Text>
</Box>
) : null}
<Box>
<Heading size="sm">Host</Heading>
<Text fontSize="sm" pt="2">
Expand Down
3 changes: 2 additions & 1 deletion functions/api/events-team/events/new.ts
Expand Up @@ -62,13 +62,14 @@ export async function onRequestPost(context: RequestContext) {
const id = `${now.getTime()}${crypto.randomUUID().replaceAll("-", "")}`;

await context.env.D1.prepare(
"INSERT INTO events (answer, created_at, created_by, day, id, month, type, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?);",
"INSERT INTO events (answer, created_at, created_by, day, details, id, month, type, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?);",
)
.bind(
context.data.body.answer || null,
now.getTime(),
context.data.current_user.id,
day,
details,
id,
currentMonth,
type,
Expand Down

0 comments on commit f1fa3c8

Please sign in to comment.