Chatwoot/app/javascript/widget/store/modules/events.js
koudshoorn af1d8c0ee5
feat: Fixes #1940 WCAG support for website widget (#2071)
Co-authored-by: Kaj Oudshoorn <kaj@milvum.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
2021-09-02 12:13:53 +05:30

29 lines
407 B
JavaScript

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,
};