From 3f24b32a31a7f9d08a6f3f460f68e871d6c940fb Mon Sep 17 00:00:00 2001 From: Andrew Kostka Date: Tue, 16 Jan 2024 10:18:21 +0000 Subject: [PATCH] Switch to inline validation for v-combobox --- .../Pages/ManageWiki/Cards/QuestyCaptcha.vue | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/Pages/ManageWiki/Cards/QuestyCaptcha.vue b/src/components/Pages/ManageWiki/Cards/QuestyCaptcha.vue index 58d67e83..a09991d2 100644 --- a/src/components/Pages/ManageWiki/Cards/QuestyCaptcha.vue +++ b/src/components/Pages/ManageWiki/Cards/QuestyCaptcha.vue @@ -30,7 +30,7 @@ outlined hide-details="auto" :append-outer-icon="showIcon ? 'mdi-delete-outline' : undefined" - :rules="[() => !!entry.question || 'Field cannot be empty. Please provide a question']" + :rules="[() => !!entry.question || 'Field cannot be empty. Please provide a question.']" @click:append-outer="removeQuestion(index)" dense > @@ -41,7 +41,7 @@ :items="entry.answers" multiple outlined - :rules="[required]" + :rules="[() => !!entry.answers.length || 'Field cannot be empty. Please provide an answer.']" hide-selected hide-details="auto" dense @@ -192,12 +192,6 @@ export default { const recoveredDefaultQuestions = this.$store.state.wikis.currentWikiSettings.defaultQuestions this.questionsFromStore = JSON.parse(JSON.stringify(recoveredDefaultQuestions)) }, - required (value) { - if (value.length === 0) { - return 'Field cannot be empty. Please provide an answer' - } - return !!value || 'Field cannot be empty. Please provide an answer' - }, closeAlert () { this.successMessage = false this.errorMessage = false