From 4ebad6b372d989e579d67d62cd338e3eac5aa415 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 22 Nov 2021 15:54:01 +0100 Subject: [PATCH] filter order was not properly being applied --- modules/item/back/methods/tag/filterValue.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/item/back/methods/tag/filterValue.js b/modules/item/back/methods/tag/filterValue.js index 6344a5299..3f39519fc 100644 --- a/modules/item/back/methods/tag/filterValue.js +++ b/modules/item/back/methods/tag/filterValue.js @@ -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));