From 595cccc97d4ab0a5d3827c268daca12452829faf Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 22 Sep 2024 18:17:24 +1000 Subject: [PATCH] fixes for switch --- app/Http/Controllers/SearchController.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index ca5cd68816..253e815b00 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -100,8 +100,9 @@ class SearchController extends Controller switch($result['_index']) { case 'clients': - if($result['_source']['is_deleted']) - continue; + if($result['_source']['is_deleted']) //do not return deleted results + break; + $this->clients[] = [ 'name' => $result['_source']['name'], @@ -113,9 +114,9 @@ class SearchController extends Controller break; case 'invoices': - if ($result['_source']['is_deleted']) { - continue; - } + if ($result['_source']['is_deleted']) //do not return deleted invoices + break; + $this->invoices[] = [ 'name' => $result['_source']['name'], @@ -126,7 +127,7 @@ class SearchController extends Controller break; case 'client_contacts': - if($result['_source']['__soft_deleted']) + if($result['_source']['__soft_deleted']) // do not return deleted contacts continue; $this->client_contacts[] = [