added infinite scrolling to frontend and displaying vote information

This commit is contained in:
jenz
2026-08-25 21:34:45 +02:00
parent ab481d6d65
commit 0634fde335
7 changed files with 240 additions and 25 deletions
@@ -239,7 +239,7 @@ export interface MapVoteRow {
vote_weight: number;
}
export async function searchMapNames(q: string, limit = 50): Promise<MapSummary[]> {
export async function searchMapNames(q: string, limit = 50, offset = 0): Promise<MapSummary[]> {
const like = `%${q}%`;
return query<MapSummary>(
`SELECT m.map_name, COUNT(*) AS times_played, MAX(m.map_start_dt) AS last_played,
@@ -249,8 +249,8 @@ export async function searchMapNames(q: string, limit = 50): Promise<MapSummary[
AND ${REAL_MAP_PERIOD}
GROUP BY m.map_name
ORDER BY last_played DESC
LIMIT ?`,
[like, limit],
LIMIT ? OFFSET ?`,
[like, limit, offset],
);
}