starting to implement search page

This commit is contained in:
Jonas Heinrich 2020-11-05 09:28:37 +01:00
parent bc3dfd23cb
commit a6fc70ac1b
4 changed files with 11 additions and 1 deletions

View File

@ -34,6 +34,7 @@ return [
['name' => 'page#index', 'url' => '/new', 'verb' => 'GET', 'postfix' => 'new'],
['name' => 'page#index', 'url' => '/favorites', 'verb' => 'GET', 'postfix' => 'favorites'],
['name' => 'page#index', 'url' => '/categories', 'verb' => 'GET', 'postfix' => 'categories'],
['name' => 'page#index', 'url' => '/search', 'verb' => 'GET', 'postfix' => 'search'],
// Settings
['name' => 'settings#set_menu_state', 'url' => '/settings/menuState', 'verb' => 'POST'],
['name' => 'settings#get_menu_state', 'url' => '/settings/menuState', 'verb' => 'GET'],

View File

@ -80,7 +80,7 @@ class SettingsController extends ApiController {
public function setMenuState($menuState = ""): JSONResponse {
$legalArguments = ['TOP', 'RECENT', 'NEW', 'FAVORITES', 'CATEGORIES'];
if (!in_array($menuState, $legalArguments)) {
return new JSONResponse(['status' => 'error'], Http::STATUS_BAD_REQUEST);
$menuState = 'TOP';
}
return $this->setSetting(
'menuState',

View File

@ -21,6 +21,10 @@
:to="{ name: 'CATEGORIES' }"
icon="icon-files-dark"
:title="t('radio', 'Categories')" />
<AppNavigationItem
:to="{ name: 'SEARCH' }"
icon="icon-search"
:title="t('radio', 'Search')" />
</template>
<template #footer>
<Player

View File

@ -38,6 +38,11 @@ const router = new Router({
component: Main,
name: 'CATEGORIES',
},
{
path: '/search',
component: Main,
name: 'SEARCH',
},
],
})