Only return messages with an event

This commit is contained in:
David Bomba 2023-10-12 17:29:24 +11:00
parent 5be3b38f96
commit 7a96c25f8b

View File

@ -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'];
}
});