From be6717ac34299701c18cb5b0efa4bbb25a66e417 Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 8 Jun 2024 21:05:10 +0200 Subject: [PATCH] stash --- web/src/store.js | 8 ++++++++ web/src/views/admin/Settings.vue | 16 +++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) 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 }}
-