Fix editor inputs

This commit is contained in:
Angelina Filippova 2020-11-13 01:32:00 +03:00
parent efa4b975d3
commit 536e77cdaa
2 changed files with 9 additions and 3 deletions

View file

@ -181,7 +181,10 @@ export default {
async onSubmit() {
try {
await this.$store.dispatch('SubmitChanges')
await this.$store.dispatch('UpdateInstanceDocs', { name: 'instance-panel', content: this.editorContent })
await this.$store.dispatch('UpdateInstanceDocs', {
name: 'instance-panel',
content: this.editorContent.length > 0 ? this.editorContent : this.instancePanelContent
})
} catch (e) {
return
}

View file

@ -114,12 +114,15 @@ export default {
},
methods: {
handleEditorUpdate(content) {
this.editorContent = content
this.termsOfServices = content
},
async onSubmit() {
try {
await this.$store.dispatch('SubmitChanges')
await this.$store.dispatch('UpdateInstanceDocs', { name: 'terms-of-service', content: this.editorContent })
await this.$store.dispatch('UpdateInstanceDocs', {
name: 'terms-of-service',
content: this.termsOfServices.length > 0 ? this.termsOfServices : this.termsOfServicesContent
})
} catch (e) {
return
}