From 73acf0bf3f644f51ff8954e330ae0995ddcd2504 Mon Sep 17 00:00:00 2001 From: Konstantin Bukin Date: Tue, 7 May 2019 15:33:56 +0300 Subject: [PATCH] Fixes --- .../src/Http/Controllers/Back/UtilityController.php | 9 +++------ .../src/Http/Controllers/Back/UtilityController.php | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/entities/entries/src/Http/Controllers/Back/UtilityController.php b/entities/entries/src/Http/Controllers/Back/UtilityController.php index 562a7a7..2492c7b 100644 --- a/entities/entries/src/Http/Controllers/Back/UtilityController.php +++ b/entities/entries/src/Http/Controllers/Back/UtilityController.php @@ -26,14 +26,11 @@ class UtilityController extends Controller implements UtilityControllerContract */ public function getSuggestions(UtilityServiceContract $utilityService, Request $request): SuggestionsResponseContract { - $search = $request->get('q', ''); - $type = $request->get('type', ''); + $search = $request->get('q', '') ?? ''; + $type = $request->get('type', '') ?? ''; $items = $utilityService->getSuggestions($search); - return $this->app->make( - SuggestionsResponseContract::class, - compact('items', 'type') - ); + return $this->app->make(SuggestionsResponseContract::class, compact('items', 'type')); } } diff --git a/entities/groups/src/Http/Controllers/Back/UtilityController.php b/entities/groups/src/Http/Controllers/Back/UtilityController.php index 82f2ffa..6c67df2 100644 --- a/entities/groups/src/Http/Controllers/Back/UtilityController.php +++ b/entities/groups/src/Http/Controllers/Back/UtilityController.php @@ -26,14 +26,11 @@ class UtilityController extends Controller implements UtilityControllerContract */ public function getSuggestions(UtilityServiceContract $utilityService, Request $request): SuggestionsResponseContract { - $search = $request->get('q', ''); - $type = $request->get('type', ''); + $search = $request->get('q', '') ?? ''; + $type = $request->get('type', '') ?? ''; $items = $utilityService->getSuggestions($search); - return $this->app->make( - SuggestionsResponseContract::class, - compact('items', 'type') - ); + return $this->app->make(SuggestionsResponseContract::class, compact('items', 'type')); } }