From cc53372fa5ebb127ab563130d0d99e61f0a9bc53 Mon Sep 17 00:00:00 2001 From: fsociety Date: Sun, 29 Sep 2024 21:26:36 +0200 Subject: [PATCH] feat: improve error handling for election event loading --- .../pages/association/election/[Election:year].blade.php | 4 +++- .../association/election/admin/[Election:year].blade.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/views/pages/association/election/[Election:year].blade.php b/resources/views/pages/association/election/[Election:year].blade.php index 68bfe9c..d577797 100644 --- a/resources/views/pages/association/election/[Election:year].blade.php +++ b/resources/views/pages/association/election/[Election:year].blade.php @@ -95,7 +95,9 @@ $loadEvents = function () { $response = $request->send(); // Check for errors in the response - if (isset($response[config('services.relay')][0]) && isset($response[config('services.relay')][0][0]) && $response[config('services.relay')][0][0] === 'ERROR') { + if (isset($response[config('services.relay')][0][0]) && $response[config( + 'services.relay' + )][0][0] === 'ERROR') { abort(500, 'Kann keine Events laden. Nostr Relay antwortet nicht.'); } diff --git a/resources/views/pages/association/election/admin/[Election:year].blade.php b/resources/views/pages/association/election/admin/[Election:year].blade.php index 06a8526..ec14ab6 100644 --- a/resources/views/pages/association/election/admin/[Election:year].blade.php +++ b/resources/views/pages/association/election/admin/[Election:year].blade.php @@ -135,7 +135,9 @@ $loadEvents = function () { $response = $request->send(); // Check for errors in the response - if (isset($response[config('services.relay')][0]) && isset($response[config('services.relay')][0][0]) && $response[config('services.relay')][0][0] === 'ERROR') { + if (isset($response[config('services.relay')][0][0]) && $response[config( + 'services.relay' + )][0][0] === 'ERROR') { abort(500, 'Kann keine Events laden. Nostr Relay antwortet nicht.'); }