2021-01-21 12:34:21 +01:00
|
|
|
/**
|
|
|
|
* see VueX docs
|
|
|
|
*/
|
2020-12-17 12:09:28 +01:00
|
|
|
export const state = () => ({
|
2023-03-02 09:53:23 +01:00
|
|
|
counter: 0,
|
|
|
|
isFetching: false,
|
|
|
|
searchInput: 'librairie interlignes',
|
2021-01-21 12:34:21 +01:00
|
|
|
selectedResult: null,
|
2023-03-02 09:53:23 +01:00
|
|
|
fetchedData: {
|
|
|
|
osm_data: '',
|
2021-01-29 12:59:44 +01:00
|
|
|
addok_data: '',
|
|
|
|
},
|
2023-03-02 09:53:23 +01:00
|
|
|
list: [],
|
|
|
|
formConfig: {
|
|
|
|
name: '',
|
2021-01-21 12:34:21 +01:00
|
|
|
delivery: false,
|
2023-03-02 09:53:23 +01:00
|
|
|
hours: ['a', 'b'],
|
|
|
|
tags: [],
|
2021-01-21 12:34:21 +01:00
|
|
|
},
|
2020-12-17 12:09:28 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
export const mutations = {
|
2021-01-28 13:12:24 +01:00
|
|
|
increment(state) {
|
2020-12-17 12:09:28 +01:00
|
|
|
state.counter++
|
|
|
|
},
|
2021-01-28 13:12:24 +01:00
|
|
|
add(state, text) {
|
2020-12-17 12:09:28 +01:00
|
|
|
state.list.push({
|
|
|
|
text,
|
|
|
|
done: false,
|
|
|
|
})
|
|
|
|
},
|
2021-01-28 13:12:24 +01:00
|
|
|
remove(state, { todo }) {
|
2023-03-02 09:53:23 +01:00
|
|
|
state.list.splice(state.list.indexOf(todo), 1)
|
2020-12-17 12:09:28 +01:00
|
|
|
},
|
2021-01-28 13:12:24 +01:00
|
|
|
setFormField(state, { field }) {
|
2023-03-02 09:53:23 +01:00
|
|
|
state.formConfig[state.formConfig.indexOf(field)] = field
|
2021-01-29 12:59:44 +01:00
|
|
|
},
|
|
|
|
setFetchedDataOsm(state, { data }) {
|
2023-03-02 09:53:23 +01:00
|
|
|
state.fetchedData.osm_data = data
|
2021-01-29 12:59:44 +01:00
|
|
|
},
|
|
|
|
setFetchedDataAddok(state, { data }) {
|
2023-03-02 09:53:23 +01:00
|
|
|
state.fetchedData.addok_data = data
|
2020-12-17 12:09:28 +01:00
|
|
|
},
|
2021-01-28 13:12:24 +01:00
|
|
|
setTag(state, { field }) {
|
2023-03-02 09:53:23 +01:00
|
|
|
state.formConfig.tags[state.formConfig.tags.indexOf(field)] = field
|
2021-01-29 12:59:44 +01:00
|
|
|
},
|
|
|
|
setSelectedResult(state, { data }) {
|
2023-03-02 09:53:23 +01:00
|
|
|
state.selectedResult = data
|
2021-01-29 12:59:44 +01:00
|
|
|
},
|
|
|
|
setFetching(state, { data }) {
|
2023-03-02 09:53:23 +01:00
|
|
|
state.isFetching = data
|
2021-01-29 12:59:44 +01:00
|
|
|
},
|
|
|
|
setAllTag(state, { tags }) {
|
2023-03-02 09:53:23 +01:00
|
|
|
state.formConfig.tags = tags
|
2021-01-21 12:34:21 +01:00
|
|
|
},
|
2020-12-17 12:09:28 +01:00
|
|
|
}
|