From f356188491e5f4261199510465b93a0d38cc8763 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 5 Jan 2023 14:54:43 +0100 Subject: [PATCH] feat: salta los tickets bloqueados --- back/methods/osticket/closeTicket.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/back/methods/osticket/closeTicket.js b/back/methods/osticket/closeTicket.js index ad2af75b7..c2f6aab1e 100644 --- a/back/methods/osticket/closeTicket.js +++ b/back/methods/osticket/closeTicket.js @@ -98,7 +98,7 @@ module.exports = Self => { for (const ticketId of ticketsId) { try { const lockCode = await getLockCode(token, secondCookie, ticketId); - if (lockCode == false) continue; + if (!lockCode) throw new Error(`Can't get lock code`); let form = new FormData(); form.append('__CSRFToken__', token); form.append('id', ticketId); @@ -123,7 +123,7 @@ module.exports = Self => { } catch (e) { const err = new Error(`${ticketId} Ticket close failed: ${e.message}`); err.stack += e.stack; - throw err; + console.error(err); } } } @@ -141,7 +141,7 @@ module.exports = Self => { const body = await response.text(); const json = JSON.parse(body); - return json.code || json.retry; + return json.code || null; } }; };