improvements
This commit is contained in:
@@ -41,6 +41,7 @@ initializeAnswers()
|
||||
|
||||
// Validation state
|
||||
const validationErrors = ref({})
|
||||
const processing = ref(false)
|
||||
const showErrors = ref(false)
|
||||
const questionRefs = ref({})
|
||||
|
||||
@@ -57,6 +58,8 @@ const saveAnswer = (questionId) => {
|
||||
preserveScroll: true,
|
||||
preserveState: true,
|
||||
only: ['answers'],
|
||||
onStart: () => { processing.value = true },
|
||||
onFinish: () => { processing.value = false },
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
@@ -160,6 +163,9 @@ const completeSession = async () => {
|
||||
router.put(`/sessions/${props.session.id}`, {
|
||||
answers: { ...answerData },
|
||||
complete: true,
|
||||
}, {
|
||||
onStart: () => { processing.value = true },
|
||||
onFinish: () => { processing.value = false },
|
||||
})
|
||||
}
|
||||
|
||||
@@ -254,7 +260,7 @@ const completeSession = async () => {
|
||||
</Transition>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<AppButton size="lg" @click="completeSession" data-cy="complete-session">
|
||||
<AppButton size="lg" :loading="processing" @click="completeSession" data-cy="complete-session">
|
||||
Complete
|
||||
</AppButton>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user