From 22fc864f60f0a87eade21ce7e1527b0b395d1c6b Mon Sep 17 00:00:00 2001 From: Basti Ortiz <39114273+BastiDood@users.noreply.github.com> Date: Sat, 10 Aug 2024 16:40:41 +0800 Subject: [PATCH] fix(draft): order draftees by family name --- database/src/database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/src/database.ts b/database/src/database.ts index e059357..3222417 100644 --- a/database/src/database.ts +++ b/database/src/database.ts @@ -303,7 +303,7 @@ export class Database implements Loggable { @timed async getStudentsInDraftTaggedByLab(draft: Draft['draft_id']) { const sql = this.#sql; const students = - await sql`SELECT email, given_name, family_name, avatar, student_number, labs, fce.lab_id FROM drap.student_ranks sr JOIN drap.users u USING (email) LEFT JOIN drap.faculty_choices_emails fce ON (sr.draft_id, email) = (fce.draft_id, student_email) WHERE sr.draft_id = ${draft}`; + await sql`SELECT email, given_name, family_name, avatar, student_number, labs, fce.lab_id FROM drap.student_ranks sr JOIN drap.users u USING (email) LEFT JOIN drap.faculty_choices_emails fce ON (sr.draft_id, email) = (fce.draft_id, student_email) WHERE sr.draft_id = ${draft} ORDER BY family_name`; return parse(TaggedStudentsWithLabs, students); }