Skip to content

Commit

Permalink
fix(db): remove references to old chosen_by field
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiDood committed Jul 11, 2024
1 parent 7cccd35 commit 64ba4f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/server/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export class Database implements Loggable {
@timed async getStudentRankings(id: StudentRank['draft_id'], email: StudentRank['email']) {
const sql = this.#sql;
const [first, ...rest] =
await sql`SELECT created_at, array_agg(lab_name) labs FROM drap.labs JOIN (SELECT created_at, unnest(labs) lab_id FROM drap.student_ranks WHERE draft_id = ${id} AND email = ${email}) ranks USING (lab_id) GROUP BY chosen_by, created_at`;
await sql`SELECT created_at, array_agg(lab_name) labs FROM drap.labs JOIN (SELECT created_at, unnest(labs) lab_id FROM drap.student_ranks WHERE draft_id = ${id} AND email = ${email}) ranks USING (lab_id) GROUP BY created_at`;
strictEqual(rest.length, 0);
return typeof first === 'undefined' ? null : parse(QueriedStudentRank, first);
}
Expand Down

0 comments on commit 64ba4f3

Please sign in to comment.