Feature: Website SDK (#653)
Add SDK functions Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
parent
7fcd2d0e85
commit
cb22b396eb
38 changed files with 734 additions and 262 deletions
32
app/javascript/widget/store/modules/conversationLabels.js
Normal file
32
app/javascript/widget/store/modules/conversationLabels.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
import conversationLabels from '../../api/conversationLabels';
|
||||
|
||||
const state = {};
|
||||
|
||||
export const getters = {};
|
||||
|
||||
export const actions = {
|
||||
create: async (_, label) => {
|
||||
try {
|
||||
await conversationLabels.create(label);
|
||||
} catch (error) {
|
||||
// Ingore error
|
||||
}
|
||||
},
|
||||
destroy: async (_, label) => {
|
||||
try {
|
||||
await conversationLabels.destroy(label);
|
||||
} catch (error) {
|
||||
// Ingore error
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export const mutations = {};
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
getters,
|
||||
actions,
|
||||
mutations,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue