Chatwoot/app/javascript/widget/store/modules/events.js

30 lines
409 B
JavaScript
Raw Normal View History

import events from 'widget/api/events';
const state = {
isOpen: false,
};
const actions = {
create: async (_, { name }) => {
try {
await events.create(name);
} catch (error) {
// Ignore error
}
},
};
const mutations = {
toggleOpen($state) {
$state.isOpen = !$state.isOpen;
},
};
export default {
namespaced: true,
state,
getters: {},
actions,
mutations,
};