create answer array and call method to save to store
This commit is contained in:
parent
60b7fe5d53
commit
3af5a3a204
1 changed files with 21 additions and 1 deletions
|
|
@ -59,6 +59,7 @@ import settleAllPromises from '@/helpers/layout-helper';
|
||||||
import { Form } from 'vee-validate';
|
import { Form } from 'vee-validate';
|
||||||
import BaseFormMixin from '@/mixins/base-form-mixin.js';
|
import BaseFormMixin from '@/mixins/base-form-mixin.js';
|
||||||
import globalRules from '@/constants/global-rules.js';
|
import globalRules from '@/constants/global-rules.js';
|
||||||
|
import { useMainStore } from '@/store';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'endorsements-page',
|
name: 'endorsements-page',
|
||||||
|
|
@ -117,7 +118,26 @@ export default {
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
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();
|
return this.navigateForward();
|
||||||
},
|
},
|
||||||
navigateForward() {
|
navigateForward() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue