create answer array and call method to save to store

This commit is contained in:
Katie Kroell 2023-09-11 14:46:38 -04:00
parent 60b7fe5d53
commit 3af5a3a204

View file

@ -59,6 +59,7 @@ import settleAllPromises from '@/helpers/layout-helper';
import { Form } from 'vee-validate';
import BaseFormMixin from '@/mixins/base-form-mixin.js';
import globalRules from '@/constants/global-rules.js';
import { useMainStore } from '@/store';
export default {
name: 'endorsements-page',
@ -117,7 +118,26 @@ export default {
backButtonAction() {
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
},
forwardButtonAction() {
async forwardButtonAction() {
// manually creating the array for now, will revise once service returns questions
const questionAnswersArray = [];
questionAnswersArray.push(
{
questionNum: 1,
questionText: this.schoolPropertyQuestionText,
selectedAnswer: this.schoolPropertyAnswer
},
{
questionNum: 2,
questionText: this.parkingLotQuestionText,
selectedAnswer: this.parkingLotAnswer
}
);
// save answers to store as order.policy.endorsementQuestionAnswers
await this.mainStore.saveEndorsementQuestionAnswers(questionAnswersArray);
return this.navigateForward();
},
navigateForward() {