From 4836dd8487338d2cfdb2d5d5b2b7291e80bc1060 Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Sun, 8 Dec 2024 12:55:44 +0100 Subject: [PATCH] aa --- app/Http/Controllers/ArticleController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index 9592e4f1..4780df7f 100755 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -32,7 +32,7 @@ class ArticleController extends Controller ->get(); if ($articoli->isEmpty()) { - return response()->json(['message' => 'Nessun articolo trovato.'], 404); + return ['error' => 'Nessun articolo']; } } catch (\Exception $e) { @@ -176,7 +176,7 @@ class ArticleController extends Controller $articoliVenduti = $this->articoliByDataStart($data_start); - if (isset($articoliVenduti['error'])) { + if ($articoliVenduti && isset($articoliVenduti['error'])) { return view('error', ['message' => $articoliVenduti['error']]); }