diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js index 557c75d9e..f05101d75 100644 --- a/modules/ticket/back/methods/ticket/filter.js +++ b/modules/ticket/back/methods/ticket/filter.js @@ -99,11 +99,13 @@ module.exports = Self => { let teamIds = []; - if (worker.collegues().length) { + if (worker.collegues().length && ctx.args.myTeam) { worker.collegues().forEach(collegue => { teamIds.push(collegue.collegueFk); }); - } else { + } + + if (ctx.args.mine || (worker.collegues().length === 0 && ctx.args.myTeam)) { worker = await Self.app.models.Worker.findOne({ fields: ['id'], where: {userFk: ctx.req.accessToken.userId} diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 42d5ad3fe..700fd9e87 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -3,7 +3,7 @@ url="/ticket/api/Tickets/filter" limit="20" data="tickets" - order="shipped DESC, clientFk" + order="shipped ASC, clientFk" auto-load="false">