stash
This commit is contained in:
parent
acf76c1d15
commit
a4c1a6fc95
2 changed files with 3 additions and 4 deletions
|
@ -446,6 +446,7 @@ const store = createStore({
|
||||||
},
|
},
|
||||||
async createMessageTemplate({commit, state}, template_name) {
|
async createMessageTemplate({commit, state}, template_name) {
|
||||||
const {data, success} = await http.post('/2/message_templates/', {name: template_name}, state.user.token);
|
const {data, success} = await http.post('/2/message_templates/', {name: template_name}, state.user.token);
|
||||||
|
const {data: newTemplates, success: newSuccess} = await http.get('/2/message_templates/', state.user.token);
|
||||||
if (data && success) {
|
if (data && success) {
|
||||||
commit('setMessageTemplates', data);
|
commit('setMessageTemplates', data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,9 @@
|
||||||
<div v-for="template in messageTemplatesIntermediate" :key="template.id" class="card bg-dark"
|
<div v-for="template in messageTemplatesIntermediate" :key="template.id" class="card bg-dark"
|
||||||
style="margin-bottom: 10px;">
|
style="margin-bottom: 10px;">
|
||||||
<div class="card-header">{{ template.name }}</div>
|
<div class="card-header">{{ template.name }}</div>
|
||||||
<div class="card-body">
|
<FormatedText :value="template.message" :format="formatText" class="card-body"
|
||||||
<FormatedText :value="template.message" :format="formatText"
|
|
||||||
@input="changeMessageTemplate(template.id, $event)"/>
|
@input="changeMessageTemplate(template.id, $event)"/>
|
||||||
</div>
|
<div class="card-body">
|
||||||
<div class="card-footer">
|
|
||||||
<button class="btn btn-primary" @click="resetMessageTemplate(template.id)"
|
<button class="btn btn-primary" @click="resetMessageTemplate(template.id)"
|
||||||
:disabled="messageTemplates.find(t => t.id === template.id).message === template.message">Reset
|
:disabled="messageTemplates.find(t => t.id === template.id).message === template.message">Reset
|
||||||
</button>
|
</button>
|
||||||
|
|
Loading…
Reference in a new issue