From 7a96c25f8b9d48dd7ea0250881e8eedc32fb34c2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 12 Oct 2023 17:29:24 +1100 Subject: [PATCH] Only return messages with an event --- app/Http/Controllers/EmailHistoryController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/EmailHistoryController.php b/app/Http/Controllers/EmailHistoryController.php index 42dea4c1625a..4da69ba7b6dc 100644 --- a/app/Http/Controllers/EmailHistoryController.php +++ b/app/Http/Controllers/EmailHistoryController.php @@ -32,7 +32,7 @@ class EmailHistoryController extends BaseController ->orderBy('id', 'DESC') ->cursor() ->map(function ($system_log) { - if($system_log->log['history'] ?? false) { + if(($system_log->log['history'] && $system_log->log['history']['events'] && count($system_log->log['history']['events']) >=1) ?? false) { return $system_log->log['history']; } }); @@ -57,7 +57,7 @@ class EmailHistoryController extends BaseController ->orderBy('id', 'DESC') ->cursor() ->map(function ($system_log) { - if($system_log->log['history'] ?? false) { + if(($system_log->log['history'] && $system_log->log['history']['events'] && count($system_log->log['history']['events']) >=1) ?? false) { return $system_log->log['history']; } });