diff --git a/web/src/store.js b/web/src/store.js index 005771d..d864d2f 100644 --- a/web/src/store.js +++ b/web/src/store.js @@ -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) { diff --git a/web/src/views/admin/Settings.vue b/web/src/views/admin/Settings.vue index 1f15a86..84cd323 100644 --- a/web/src/views/admin/Settings.vue +++ b/web/src/views/admin/Settings.vue @@ -4,7 +4,7 @@
{{ template.name }}
-