Merge pull request 'hotfix-ticketState' (!2708) from hotfix-ticketState into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2708 Reviewed-by: Alex Moreno <alexm@verdnatura.es> Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
dcdbc20fe4
|
@ -347,6 +347,18 @@ module.exports = Self => {
|
||||||
if (hasWhere)
|
if (hasWhere)
|
||||||
stmt.merge(conn.makeWhere(problems));
|
stmt.merge(conn.makeWhere(problems));
|
||||||
|
|
||||||
|
if (filter.order) {
|
||||||
|
if (typeof filter.order == 'string') filter.order = [filter.order];
|
||||||
|
const index = filter.order.findIndex(o => o.includes('stateFk'));
|
||||||
|
if (index > -1) {
|
||||||
|
filter.order = [
|
||||||
|
...filter.order.slice(0, index),
|
||||||
|
'refFk ' + filter.order[index].split(' ')[1],
|
||||||
|
...filter.order.slice(index)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stmt.merge(conn.makeOrderBy(filter.order));
|
stmt.merge(conn.makeOrderBy(filter.order));
|
||||||
stmt.merge(conn.makeLimit(filter));
|
stmt.merge(conn.makeLimit(filter));
|
||||||
const ticketsIndex = stmts.push(stmt) - 1;
|
const ticketsIndex = stmts.push(stmt) - 1;
|
||||||
|
|
Loading…
Reference in New Issue