|
|
|
@ -10,6 +10,12 @@ const mutations = {
|
|
|
|
|
const existingItem = state.items.find((i) => i.id === item.id)
|
|
|
|
|
Object.assign(existingItem, item)
|
|
|
|
|
},
|
|
|
|
|
REMOVE_FREQUENCY: (state, item) => {
|
|
|
|
|
const index = state.items.indexOf(item)
|
|
|
|
|
if (index > -1) {
|
|
|
|
|
state.items.splice(index, 1)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
SET_FREQUENCIES (state, frequencies) {
|
|
|
|
|
Vue.set(state, 'items', frequencies)
|
|
|
|
|
}
|
|
|
|
@ -22,6 +28,9 @@ const actions = {
|
|
|
|
|
async updateFrequency (context, frequency) {
|
|
|
|
|
context.commit('SET_GROUND', frequency)
|
|
|
|
|
},
|
|
|
|
|
async removeFrequency (context, frequency) {
|
|
|
|
|
context.commit('REMOVE_FREQUENCY', frequency)
|
|
|
|
|
},
|
|
|
|
|
async setFrequencies (context, frequencies) {
|
|
|
|
|
context.commit('SET_FREQUENCIES', frequencies)
|
|
|
|
|
}
|
|
|
|
|