From be4962a02ac6e7101c68d45bdc2fc02f8569ebc2 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Thu, 12 Sep 2024 23:15:10 +0300 Subject: [PATCH] adjust form completion --- app/javascript/submission_form/form.vue | 37 +++++++++++++++---------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/app/javascript/submission_form/form.vue b/app/javascript/submission_form/form.vue index 4b7e6a20..946a3aca 100644 --- a/app/javascript/submission_form/form.vue +++ b/app/javascript/submission_form/form.vue @@ -70,7 +70,7 @@ :class="{ 'md:px-4': isBreakpointMd }" >
{ console.error(error) @@ -1202,6 +1194,21 @@ export default { }).finally(() => { this.isSubmitting = false }) + }, + async performComplete (resp) { + this.isCompleted = true + + if (resp) { + const respData = await resp.text() + + if (respData) { + this.onComplete(JSON.parse(respData)) + } + } + + if (this.completedRedirectUrl) { + window.location.href = this.completedRedirectUrl + } } } }