fix: corretta pulizia delle code quando si passa con il tab. feat: aggiunto shortcut per tornare alla pagina ticket.

This commit is contained in:
Gabriele Cimaschi committed 2026-09-14 11:57:02 +02:00
1 parent c33a7a4666
commit 1bc3d8bf8a
4 files changed
+29 -5

No files matched your search

+3 -2
View File
@@ -916,8 +916,8 @@ router.patch('/:id', async (req, res) => {
if (updates.type_id !== undefined) ticketFields.TypeID = updates.type_id;
if (updates.title !== undefined) ticketFields.Title = updates.title;
if (updates.ticket_lock_id !== undefined) ticketFields.LockID = updates.ticket_lock_id;
if (updates.customer_id !== undefined) ticketFields.CustomerID = updates.customer_id;
if (updates.customer_user_id !== undefined) ticketFields.CustomerUser = updates.customer_user_id;
if (updates.customer_id !== undefined && updates.customer_id !== null && updates.customer_id !== '') ticketFields.CustomerID = updates.customer_id;
if (updates.customer_user_id !== undefined && updates.customer_user_id !== null && updates.customer_user_id !== '') ticketFields.CustomerUser = updates.customer_user_id;
// If ticketFields is empty but we have a note or timeUnit to log, supply a dummy field (StateID) so Ticket is not empty
if (Object.keys(ticketFields).length === 0 && (hasNote || (!isNaN(timeUnit) && timeUnit > 0))) {
@@ -986,6 +986,7 @@ router.patch('/:id', async (req, res) => {
const client = await pool.connect();
try {
await client.query('BEGIN');
const localNow = getLocalTimestamp();
// If state is changing, check if the target state is a closed state type to auto-unlock
if (updates.ticket_state_id && updates.ticket_state_id !== current.ticket_state_id) {