diff --git a/application/controllers/api/frontend/v1/Searchbar.php b/application/controllers/api/frontend/v1/Searchbar.php index d1444cbad..1f51334fc 100644 --- a/application/controllers/api/frontend/v1/Searchbar.php +++ b/application/controllers/api/frontend/v1/Searchbar.php @@ -62,6 +62,9 @@ class Searchbar extends FHCAPI_Controller $result = $this->searchbarlib->search($this->input->post(self::SEARCHSTR_PARAM), $this->input->post(self::TYPES_PARAM)); if (property_exists($result, 'error')) $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + + $this->addMeta('mode', 'simple'); + $this->terminateWithSuccess($result->data); } @@ -87,6 +90,7 @@ class Searchbar extends FHCAPI_Controller $this->addMeta('time', $result->meta['time']); $this->addMeta('searchstring', $result->meta['searchstring']); + $this->addMeta('mode', 'advanced'); $this->terminateWithSuccess($data); } diff --git a/public/js/components/searchbar/searchbar.js b/public/js/components/searchbar/searchbar.js index 38e07388d..4db7869c7 100644 --- a/public/js/components/searchbar/searchbar.js +++ b/public/js/components/searchbar/searchbar.js @@ -16,6 +16,7 @@ export default { types: this.getSearchTypes(), }, searchresult: [], + searchmode: '', showresult: false, searching: false, error: null, @@ -270,6 +271,7 @@ export default { } } this.searchresult = res; + this.searchmode = response.meta.mode; } this.searching = false; this.retry = 0;