Skip to content

Commit

Permalink
fix: delete QA bundle before saving
Browse files Browse the repository at this point in the history
  • Loading branch information
dati18 committed Jan 10, 2024
1 parent 0af47f9 commit 3096695
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/Pages/ManageWiki/Cards/QuestyCaptcha.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default {
},
removeQuestion (index) {
this.questionsFromStore.splice(index, 1)
// hide trash icon when there is just one QA bundle
if (this.questionsFromStore.length === 1) {
this.showIcon = false
}
Expand All @@ -137,12 +137,16 @@ export default {
question: '',
answers: []
})
if (this.questionsFromStore.length > 1) {
this.showIcon = true
}
// show the trash icon again when there are more than one QA bundle
this.showIcon = true
},
saveForm () {
for (let i = 0; i < this.questionsFromStore.length; i++) {
const entry = this.questionsFromStore[i]
if (!entry.question.trim() && !entry.answers) {
this.removeQuestion(i)
}
}
if (!this.$refs.questyForm.validate()) {
return
}
Expand Down

0 comments on commit 3096695

Please sign in to comment.