From 491941a3e8b23b48cfbda0329154709a5e7c870a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Mon, 27 Apr 2020 18:27:51 +0200 Subject: [PATCH] Properly update question MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- src/components/Questions/AnswerInput.vue | 1 + src/components/Questions/Question.vue | 27 +++++++++++++++++++++++- src/mixins/QuestionMixin.js | 1 + src/utils/GenRandomId.js | 2 +- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/components/Questions/AnswerInput.vue b/src/components/Questions/AnswerInput.vue index 424e74b..143d7a7 100644 --- a/src/components/Questions/AnswerInput.vue +++ b/src/components/Questions/AnswerInput.vue @@ -135,6 +135,7 @@ export default { questionId: answer.question_id, text: answer.text, }) + console.debug('Created answer', answer) // Was synced once, this is now up to date with the server delete answer.local diff --git a/src/components/Questions/Question.vue b/src/components/Questions/Question.vue index 6fde335..b188195 100644 --- a/src/components/Questions/Question.vue +++ b/src/components/Questions/Question.vue @@ -42,7 +42,8 @@ minlength="1" maxlength="256" required - @input="onInput"> + @input="onInput" + @keyup="onTitleChange">

@@ -57,7 +58,12 @@ diff --git a/src/mixins/QuestionMixin.js b/src/mixins/QuestionMixin.js index 4056d30..27a73de 100644 --- a/src/mixins/QuestionMixin.js +++ b/src/mixins/QuestionMixin.js @@ -23,6 +23,7 @@ import Question from '../components/Questions/Question' export default { inheritAttrs: false, props: { + /** * The question title */ diff --git a/src/utils/GenRandomId.js b/src/utils/GenRandomId.js index aa0d6fc..275735e 100644 --- a/src/utils/GenRandomId.js +++ b/src/utils/GenRandomId.js @@ -1,6 +1,6 @@ /** - * @copyright Copyright (c) 2018 John Molakvoæ + * @copyright Copyright (c) 2020 John Molakvoæ * * @author John Molakvoæ *