Fixed message_limit issue on domains

This commit is contained in:
Spitap
2023-09-01 13:53:43 +02:00
parent 1794ec9feb
commit 6258f85a54
3 changed files with 16 additions and 12 deletions
@@ -92,7 +92,7 @@ export default {
items: [
{ key: this.$gettext('Quota'), value: this.domain.quota },
{ key: this.$gettext('Default mailbox quota'), value: this.domain.default_mailbox_quota },
{ key: this.$gettext('Message sending limit'), value: this.domain.message_sending_limit }
{ key: this.$gettext('Message sending limit'), value: this.domain.message_limit }
]
}
]
@@ -89,8 +89,8 @@
<v-col cols="6">
<translate class="mr-2">Quota: </translate> {{ domain.quota }}
</v-col>
<v-col cols="6" v-if="domain.message_sending_limit">
<translate class="mr-2">Sending limit: </translate> {{ domain.message_sending_limit }}
<v-col cols="6" v-if="domain.message_limit">
<translate class="mr-2">Sending limit: </translate> {{ domain.message_limit }}
</v-col>
<v-col cols="6" v-else>
<translate class="mr-2">No sending limit</translate>
@@ -207,7 +207,7 @@ export default {
}
this.working = true
try {
const data = { ...this.editedDomain }
const data = JSON.parse(JSON.stringify(this.editedDomain))
if (data.transport === null) {
delete data.transport
}
@@ -231,7 +231,7 @@ export default {
domain: {
handler: function (val) {
if (val) {
this.editedDomain = JSON.parse(JSON.stringify(val))
this.editedDomain = { ...val }
}
},
immediate: true
@@ -38,7 +38,7 @@
:label="'Message sending limit' | translate"
:hint="'Number of messages this domain can send per day. Leave empty for no limit.' | translate"
persistent-hint
v-model="form.message_sending_limit"
v-model="form.message_limit"
:error-messages="errors"
outlined
@input="update"
@@ -49,9 +49,7 @@
<script>
export default {
props: {
value: Object
},
props: ['value'],
data () {
return {
form: {}
@@ -65,12 +63,18 @@ export default {
this.$emit('input', this.form)
}
},
mounted () {
this.form = { ...this.value }
},
watch: {
value: {
handler: function (newValue) {
this.form = { ...this.value }
handler (newValue) {
if (newValue.message_limit === '') {
newValue.message_limit = null
}
this.form = { ...newValue }
},
immediate: true
deep: true
}
}
}