2020-04-10 11:12:37 +00:00
|
|
|
import events from 'widget/api/events';
|
|
|
|
|
2021-09-02 06:43:53 +00:00
|
|
|
const state = {
|
|
|
|
isOpen: false,
|
2021-11-09 16:06:32 +00:00
|
|
|
};
|
2021-09-02 06:43:53 +00:00
|
|
|
|
2020-04-10 11:12:37 +00:00
|
|
|
const actions = {
|
|
|
|
create: async (_, { name }) => {
|
|
|
|
try {
|
|
|
|
await events.create(name);
|
|
|
|
} catch (error) {
|
|
|
|
// Ignore error
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2021-09-02 06:43:53 +00:00
|
|
|
const mutations = {
|
|
|
|
toggleOpen($state) {
|
|
|
|
$state.isOpen = !$state.isOpen;
|
2021-11-09 16:06:32 +00:00
|
|
|
},
|
2021-09-02 06:43:53 +00:00
|
|
|
};
|
|
|
|
|
2020-04-10 11:12:37 +00:00
|
|
|
export default {
|
|
|
|
namespaced: true,
|
2021-09-02 06:43:53 +00:00
|
|
|
state,
|
2020-04-10 11:12:37 +00:00
|
|
|
getters: {},
|
|
|
|
actions,
|
2021-09-02 06:43:53 +00:00
|
|
|
mutations,
|
2020-04-10 11:12:37 +00:00
|
|
|
};
|