100-recruitment-ui-fixes #101

Merged
Ajdj100 merged 6 commits from 100-recruitment-ui-fixes into main 2025-12-15 12:34:31 -06:00
Showing only changes of commit 1dfdb6bd0e - Show all commits

View File

@@ -31,7 +31,7 @@ export async function getApplicationByID(appID: number): Promise<ApplicationRow>
return app[0];
}
export async function getApplicationList(): Promise<ApplicationListRow[]> {
export async function getApplicationList(page: number = 1, pageSize: number = 25): Promise<ApplicationListRow[]> {
const sql = `SELECT
member.name AS member_name,
app.id,
@@ -40,9 +40,11 @@ export async function getApplicationList(): Promise<ApplicationListRow[]> {
app.app_status
FROM applications AS app
LEFT JOIN members AS member
ON member.id = app.member_id;`
ON member.id = app.member_id
ORDER BY app.submitted_at DESC
LIMIT ? OFFSET ?;`
const rows: ApplicationListRow[] = await pool.query(sql);
const rows: ApplicationListRow[] = await pool.query(sql, [pageSize, page]);
return rows;
}