From 26a8506ec25ddbe1e2502196ea3d56597caa77bf Mon Sep 17 00:00:00 2001 From: Thijn Date: Wed, 20 Nov 2024 14:20:49 +0100 Subject: [PATCH] fixed feedback on synchronization test --- lib/Service/SynchronizationService.php | 4 ++ src/modals/Modals.vue | 2 +- .../Synchronization/TestSynchronization.vue | 71 +++++++++---------- 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/lib/Service/SynchronizationService.php b/lib/Service/SynchronizationService.php index 920ec6e..80d7069 100644 --- a/lib/Service/SynchronizationService.php +++ b/lib/Service/SynchronizationService.php @@ -385,6 +385,10 @@ public function getAllObjectsFromApi(Synchronization $synchronization, ?bool $is // Make the initial API call $response = $this->callService->call(source: $source, endpoint: $endpoint, method: 'GET', config: $config)->getResponse(); $body = json_decode($response['body'], true); + if (empty($body) === true) { + // @todo log that we got a empty response + return []; + } $objects = array_merge($objects, $this->getAllObjectsFromArray(array: $body, synchronization: $synchronization)); // Return a single object or empty array if in test mode diff --git a/src/modals/Modals.vue b/src/modals/Modals.vue index 2e4ebf2..d6a6251 100644 --- a/src/modals/Modals.vue +++ b/src/modals/Modals.vue @@ -27,7 +27,7 @@ import { navigationStore } from '../store/store.js' - + diff --git a/src/modals/Synchronization/TestSynchronization.vue b/src/modals/Synchronization/TestSynchronization.vue index d969410..7e83dde 100644 --- a/src/modals/Synchronization/TestSynchronization.vue +++ b/src/modals/Synchronization/TestSynchronization.vue @@ -3,8 +3,7 @@ import { synchronizationStore, navigationStore } from '../../store/store.js'