filter order was not properly being applied
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-11-22 15:54:01 +01:00
parent 3a2e4c54b6
commit 4ebad6b372
1 changed files with 2 additions and 2 deletions

View File

@ -48,13 +48,13 @@ module.exports = Self => {
if (where && where.value) {
stmt.merge(conn.makeWhere({value: {like: `%${where.value}%`}}));
const newStmt = new ParameterizedSQL(
const orderStmt = new ParameterizedSQL(
`ORDER BY value LIKE ? DESC,
value LIKE ? DESC`, [
where.value,
`${where.value}%`
]);
ParameterizedSQL.append(newStmt, stmt);
ParameterizedSQL.append(stmt, orderStmt);
}
stmt.merge(conn.makeLimit(filter));