This commit is contained in:
j3d1 2024-06-08 21:05:10 +02:00
parent e9f192f92e
commit be6717ac34
2 changed files with 13 additions and 11 deletions

View file

@ -448,6 +448,14 @@ const store = createStore({
commit('setMessageTemplates', data);
}
},
async updateMessageTemplate({commit, state}, template) {
const {data, success} = await http.patch(`/2/message_templates/${template.id}/`,
{'message': template.message}, state.user.token);
const {data: newTemplates, success: newSuccess} = await http.get('/2/message_templates/', state.user.token);
if (data && success) {
commit('setMessageTemplates', data);
}
},
async fetchMessageTemplateVariables({commit, state}) {
const {data, success} = await http.get('/2/message_template_variables/', state.user.token);
if (data && success) {