hotfix-ticketState #2708

Merged
carlossa merged 3 commits from hotfix-ticketState into master 2024-07-09 10:13:31 +00:00
1 changed files with 12 additions and 0 deletions

View File

@ -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'));
Review

El problema venia de que en el front si te factura, la mostra encomter del state. Pero a la hora de filtrar, filtra per stateFk.

De esta manera si te stateFk, li fica també refFk

El problema venia de que en el front si te factura, la mostra encomter del state. Pero a la hora de filtrar, filtra per stateFk. De esta manera si te stateFk, li fica també refFk
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;