From 169067b21704682d6907f029eb66d8593e128087 Mon Sep 17 00:00:00 2001 From: Dasc3er Date: Wed, 24 Feb 2021 17:40:48 +0100 Subject: [PATCH] Correzione per rimozione righe da azione rapida API --- src/API/App/v1/Flash/Intervento.php | 4 +++- src/Common/Components/Component.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/API/App/v1/Flash/Intervento.php b/src/API/App/v1/Flash/Intervento.php index 96a4d8721..0bb72ae00 100644 --- a/src/API/App/v1/Flash/Intervento.php +++ b/src/API/App/v1/Flash/Intervento.php @@ -84,7 +84,9 @@ class Intervento extends Resource implements UpdateInterface // Salvataggio delle modifiche foreach ($records as [$record, $risorsa]) { - if (!empty($record['remote_id'])) { + if (!empty($record['deleted_at'])) { + $risorsa->deleteRecord($record['id']); + } elseif (!empty($record['remote_id'])) { $risorsa->updateRecord($record); } else { $risorsa->createRecord($record); diff --git a/src/Common/Components/Component.php b/src/Common/Components/Component.php index 508a17c2a..f43b9e0f1 100644 --- a/src/Common/Components/Component.php +++ b/src/Common/Components/Component.php @@ -180,7 +180,10 @@ abstract class Component extends Model $original->getDocument()->triggerEvasione($this); } - reorderRows($this->table, $this->getDocumentID(), $this->getDocument()['id']); + // Ordine delle righe successivamente alla rimozione + if (empty($this->disableOrder)) { + reorderRows($this->table, $this->getDocumentID(), $this->getDocument()['id']); + } return $result; }