fix(students): use array-style params for better-sqlite3 compatibility
This commit is contained in:
1 parent
497a38d405
commit
4df929e1df
1 file changed
+2
-2
@@ -230,7 +230,7 @@ exports.getAllStudents = (req, res) => {
|
||||
${enrollmentJoin}
|
||||
${whereClause}
|
||||
`;
|
||||
const total = db.prepare(countSql).get(...buildParams());
|
||||
const total = db.prepare(countSql).get(buildParams()).total;
|
||||
|
||||
const orderDir = (sortOrder || '').toLowerCase() === 'desc' ? 'DESC' : 'ASC';
|
||||
let orderByClause = `ORDER BY s.last_name ASC, s.first_name ASC`;
|
||||
@@ -268,7 +268,7 @@ exports.getAllStudents = (req, res) => {
|
||||
LIMIT ? OFFSET ?
|
||||
`;
|
||||
|
||||
const students = db.prepare(fetchSql).all(...buildParams(limitNum, offset));
|
||||
const students = db.prepare(fetchSql).all(buildParams(limitNum, offset));
|
||||
|
||||
// ---- Attach missingDocumentsCount badge ----
|
||||
const studentsWithBadges = students.map(student => {
|
||||
|
||||
Reference in new issue
Block a user