refactored grid with flex, displayed footer tabs, diplay results, toggle results display

This commit is contained in:
2019-09-22 18:23:40 +02:00
parent c9e7a335c1
commit 63f3c6409f
9 changed files with 350 additions and 45 deletions
+13 -1
View File
@@ -7,7 +7,9 @@ export default {
// initial state
state: {
keys: '',
results: []
results: [],
isloading: false,
opened: false
},
// getters
@@ -20,6 +22,12 @@ export default {
},
setResults (state, content) {
state.results = content
},
setIsloading (state, isloading) {
state.isloading = isloading
},
setOpened (state, opened) {
state.opened = opened
}
},
@@ -27,6 +35,7 @@ export default {
actions: {
getResults ({ dispatch, commit, state }) {
console.log('getResults', state.keys)
commit('setIsloading', true)
let params = {
search: state.keys
}
@@ -35,10 +44,13 @@ export default {
return REST.get(`/search?` + q)
.then(({ data }) => {
console.log('search REST: data', data)
commit('setIsloading', false)
commit('setOpened', true)
commit('setResults', data.content)
})
.catch((error) => {
console.warn('Issue with search', error)
commit('setIsloading', false)
Promise.reject(error)
})
}