This commit is contained in:
j3d1 2024-06-08 20:30:56 +02:00
parent 33a7423fef
commit b08f9a7127

View file

@ -1,7 +1,7 @@
<template>
<h3 class="text-center">Message Templates</h3>
<ul>
<li v-for="template in messageTemplates" :key="template.id">
<li v-for="template in messageTemplatesIntermediate" :key="template.id">
<b>{{ template.name }}</b><br>
<FormatedText :value="template.message" :format="formatText" class="template-message"
@input="changeMessageTemplate(template.id, $event)"/>
@ -20,7 +20,10 @@
{{ variable }}
</span>
</p>
{{ messageTemplatesIntermediate }}
<hr>
{{ messageTemplates }}
<hr>
{{messageTemplatesIntermediate}}
</template>
<script>
@ -46,7 +49,7 @@ export default {
},
changeMessageTemplate(id, message) {
console.log(id, message);
this.messageTemplates.forEach(template => {
this.messageTemplatesIntermediate.forEach(template => {
if (template.id === id) {
template.message = message;
}
@ -61,7 +64,7 @@ export default {
},
mounted() {
this.fetchMessageTemplates().then(() => {
this.messageTemplatesIntermediate = this.messageTemplates;
this.messageTemplatesIntermediate = [...this.messageTemplates];
});
this.fetchMessageTemplateVariables();
},