Merge pull request 'fixed bug that caused the latest application to be hidden' (#111) from Recruiter-fix into main
All checks were successful
Continuous Integration / Update Development (push) Successful in 2m43s
Continuous Deployment / Update Deployment (push) Successful in 2m24s

Reviewed-on: #111
This commit was merged in pull request #111.
This commit is contained in:
2025-12-16 17:26:55 -06:00

View File

@@ -32,6 +32,8 @@ export async function getApplicationByID(appID: number): Promise<ApplicationRow>
} }
export async function getApplicationList(page: number = 1, pageSize: number = 25): Promise<ApplicationListRow[]> { export async function getApplicationList(page: number = 1, pageSize: number = 25): Promise<ApplicationListRow[]> {
const offset = (page - 1) * pageSize;
const sql = `SELECT const sql = `SELECT
member.name AS member_name, member.name AS member_name,
app.id, app.id,
@@ -44,7 +46,7 @@ export async function getApplicationList(page: number = 1, pageSize: number = 25
ORDER BY app.submitted_at DESC ORDER BY app.submitted_at DESC
LIMIT ? OFFSET ?;` LIMIT ? OFFSET ?;`
const rows: ApplicationListRow[] = await pool.query(sql, [pageSize, page]); const rows: ApplicationListRow[] = await pool.query(sql, [pageSize, offset]);
return rows; return rows;
} }