From b142109af13d999d3c5f21cdd1ffc4cef305ddb6 Mon Sep 17 00:00:00 2001 From: RainbowJM Date: Wed, 18 Jan 2023 11:33:26 +0000 Subject: [PATCH] Datamodel changed from string to array when voting --- components/auton_proposal/AutonProposalSubmit.vue | 4 +++- pages/auton/_autonId/proposal/_proposalId/voting.vue | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/auton_proposal/AutonProposalSubmit.vue b/components/auton_proposal/AutonProposalSubmit.vue index fbe85fb..626b250 100644 --- a/components/auton_proposal/AutonProposalSubmit.vue +++ b/components/auton_proposal/AutonProposalSubmit.vue @@ -306,6 +306,8 @@ export default { } else if (this.step == "questions" && this.selectedProposalType == "questionnaire") { this.step = "question-answer" + console.log(this.titleMessage, this.descriptionMessage) + console.log("questions", this.choicesMessage) } else if (this.step == "question-answer" && this.selectedProposalType == "questionnaire") { this.step = "check-out"; @@ -353,7 +355,7 @@ export default { this.transaction.assetId = 1; this.transaction.assets = asset; } - //questionnaire data that gets send when chosen: + // questionnaire data that gets send when chosen: else if (this.step == "sign" && this.selectedProposalType == "questionnaire") { const autonWrapper = await this.$invoke("auton:getByID", { id: this.autonId }); this.uri = `/auton/${this.autonName.replace(" ", "_")}/proposal/${autonWrapper.result.proposals.length + 1}/campaigning`; diff --git a/pages/auton/_autonId/proposal/_proposalId/voting.vue b/pages/auton/_autonId/proposal/_proposalId/voting.vue index 6927056..f825948 100644 --- a/pages/auton/_autonId/proposal/_proposalId/voting.vue +++ b/pages/auton/_autonId/proposal/_proposalId/voting.vue @@ -410,7 +410,7 @@ export default { methods: { getAnswerValue(value){ - this.transaction.assets.answer = value + this.transaction.assets.answer = [[value]]; this.chipText = value this.dialog = true; }, @@ -432,12 +432,12 @@ export default { }, accept() { this.chipText = "In favor"; - this.transaction.assets.answer = "ACCEPT"; + this.transaction.assets.answer = [[ACCEPT]]; this.dialog = true; }, refuse() { this.chipText = "Against"; - this.transaction.assets.answer = "REFUSE"; + this.transaction.assets.answer = [[REFUSE]]; this.dialog = true; } }