Return roblox id on report page
This commit is contained in:
parent
911089a69c
commit
a2b3391bda
@ -35,7 +35,7 @@ export async function loader({ context }: { context: RequestContext }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const eventMemberQuery = await context.env.D1.prepare(
|
const eventMemberQuery = await context.env.D1.prepare(
|
||||||
"SELECT id, name FROM et_members;",
|
"SELECT id, name, roblox_id FROM et_members;",
|
||||||
).all();
|
).all();
|
||||||
const eventsQuery = await context.env.D1.prepare(
|
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 = ?;",
|
"SELECT answered_at, created_by, performed_at, reached_minimum_player_count, type FROM events WHERE month = ? AND year = ?;",
|
||||||
@ -44,7 +44,10 @@ export async function loader({ context }: { context: RequestContext }) {
|
|||||||
.all();
|
.all();
|
||||||
const memberMap = Object.fromEntries(
|
const memberMap = Object.fromEntries(
|
||||||
eventMemberQuery.results.map((entry) => {
|
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 },
|
||||||
|
];
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -74,7 +77,7 @@ export async function loader({ context }: { context: RequestContext }) {
|
|||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const data = useLoaderData<typeof loader>() as {
|
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();
|
const now = new Date();
|
||||||
let month = now.getUTCMonth();
|
let month = now.getUTCMonth();
|
||||||
@ -100,6 +103,7 @@ export default function () {
|
|||||||
<Th>ID</Th>
|
<Th>ID</Th>
|
||||||
<Th>Name</Th>
|
<Th>Name</Th>
|
||||||
<Th>Points</Th>
|
<Th>Points</Th>
|
||||||
|
<Th>Roblox ID</Th>
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
<Tbody>
|
<Tbody>
|
||||||
@ -108,6 +112,7 @@ export default function () {
|
|||||||
<Td>{key}</Td>
|
<Td>{key}</Td>
|
||||||
<Td>{value.name}</Td>
|
<Td>{value.name}</Td>
|
||||||
<Td>{value.points}</Td>
|
<Td>{value.points}</Td>
|
||||||
|
<Td>{value.roblox_id}</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
))}
|
))}
|
||||||
</Tbody>
|
</Tbody>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user