Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Return roblox id on report page
  • Loading branch information
regalijan committed May 3, 2024
1 parent 911089a commit a2b3391
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/routes/events-team_.report.tsx
Expand Up @@ -35,7 +35,7 @@ export async function loader({ context }: { context: RequestContext }) {
}

const eventMemberQuery = await context.env.D1.prepare(
"SELECT id, name FROM et_members;",
"SELECT id, name, roblox_id FROM et_members;",
).all();
const eventsQuery = await context.env.D1.prepare(
"SELECT answered_at, created_by, performed_at, reached_minimum_player_count, type FROM events WHERE month = ? AND year = ?;",
Expand All @@ -44,7 +44,10 @@ export async function loader({ context }: { context: RequestContext }) {
.all();
const memberMap = Object.fromEntries(
eventMemberQuery.results.map((entry) => {
return [entry.id, { name: entry.name, points: 0 }];
return [
entry.id,
{ name: entry.name, points: 0, roblox_id: entry.roblox_id },
];
}),
);

Expand Down Expand Up @@ -74,7 +77,7 @@ export async function loader({ context }: { context: RequestContext }) {

export default function () {
const data = useLoaderData<typeof loader>() as {
[k: string]: { name: string; points: number };
[k: string]: { name: string; points: number; roblox_id?: number };
};
const now = new Date();
let month = now.getUTCMonth();
Expand All @@ -100,6 +103,7 @@ export default function () {
<Th>ID</Th>
<Th>Name</Th>
<Th>Points</Th>
<Th>Roblox ID</Th>
</Tr>
</Thead>
<Tbody>
Expand All @@ -108,6 +112,7 @@ export default function () {
<Td>{key}</Td>
<Td>{value.name}</Td>
<Td>{value.points}</Td>
<Td>{value.roblox_id}</Td>
</Tr>
))}
</Tbody>
Expand Down

0 comments on commit a2b3391

Please sign in to comment.