From 6d66c0f71f6c6765b46ae7fdad2a8747f02d0889 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 20 May 2024 11:14:30 +0200 Subject: [PATCH 1/2] hotfix TicketLog filter --- modules/ticket/back/models/ticket-log.json | 3 ++- modules/ticket/front/descriptor-menu/index.js | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/ticket/back/models/ticket-log.json b/modules/ticket/back/models/ticket-log.json index 32b4afd13..d75589f11 100644 --- a/modules/ticket/back/models/ticket-log.json +++ b/modules/ticket/back/models/ticket-log.json @@ -8,7 +8,8 @@ }, "properties": { "id": { - "type": "string" + "type": "number", + "id": true }, "originFk": { "type": "number" diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index 52cac141c..89590e86a 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -37,14 +37,15 @@ class Controller extends Section { }); const filter = { - fields: ['originFk', 'creationDate', 'newInstance'], + fields: ['id', 'originFk', 'creationDate', 'newInstance'], where: { originFk: value, newInstance: {like: '%"isDeleted":true%'} }, - order: 'creationDate DESC' + order: 'creationDate DESC', + limit: 1 }; - this.$http.get(`TicketLogs/findOne`, {filter}) + this.$http.get(`TicketLogs`, {filter}) .then(res => { if (res && res.data) { const now = Date.vnNew(); From f82b1054306ad370948010248e5cdfded6fff6b2 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 20 May 2024 11:30:43 +0200 Subject: [PATCH 2/2] fix: TicketLog res.data --- modules/ticket/front/descriptor-menu/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index 89590e86a..32f245454 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -47,9 +47,9 @@ class Controller extends Section { }; this.$http.get(`TicketLogs`, {filter}) .then(res => { - if (res && res.data) { + if (res && res.data && res.data.length) { const now = Date.vnNew(); - const maxDate = new Date(res.data.creationDate); + const maxDate = new Date(res.data[0].creationDate); maxDate.setHours(maxDate.getHours() + 1); if (now <= maxDate) return this.canRestoreTicket = true;