[web] Use named route for search pages

Switching to named routes in order to reduce future maintenance.
This commit is contained in:
Alain Nussbaumer
2023-07-12 22:39:21 +02:00
parent 845f111c29
commit 6f1f53007d
6 changed files with 19 additions and 18 deletions

View File

@@ -50,7 +50,7 @@ export default createStore({
list: []
},
search_path: '/search/library',
search_source: 'library',
recent_searches: [],
composer_tracks_sort: 1,
@@ -222,8 +222,8 @@ export default createStore({
state.notifications.list.splice(index, 1)
}
},
[types.SEARCH_PATH](state, searchPath) {
state.search_path = searchPath
[types.SEARCH_SOURCE](state, searchSource) {
state.search_source = searchSource
},
[types.ADD_RECENT_SEARCH](state, query) {
const index = state.recent_searches.findIndex((elem) => elem === query)

View File

@@ -18,7 +18,7 @@ export const SPOTIFY_FEATURED_PLAYLISTS = 'SPOTIFY_FEATURED_PLAYLISTS'
export const ADD_NOTIFICATION = 'ADD_NOTIFICATION'
export const DELETE_NOTIFICATION = 'DELETE_NOTIFICATION'
export const SEARCH_PATH = 'SEARCH_PATH'
export const SEARCH_SOURCE = 'SEARCH_SOURCE'
export const ADD_RECENT_SEARCH = 'ADD_RECENT_SEARCH'
export const COMPOSER_TRACKS_SORT = 'COMPOSER_TRACKS_SORT'