Skip to content

Commit 745517d

Browse files
committed
fix crazy vote result string
1 parent 378c6b5 commit 745517d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/scripts/import.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export default async (procedureIds) => {
4343
if (h.decision) {
4444
return h.decision.some((decision) => {
4545
if (decision.type === 'Namentliche Abstimmung') {
46-
const vResults = decision.comment.split(':');
46+
const voteResultsRegEx = /(\d{1,3}:\d{1,3}:\d{1,3})/;
47+
const vResults = decision.comment.match(voteResultsRegEx)[0].split(':');
4748
voteResults = {
4849
yes: vResults[0],
4950
no: vResults[1],

src/scripts/importAll.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export default async () => {
4444
if (h.decision) {
4545
return h.decision.some((decision) => {
4646
if (decision.type === 'Namentliche Abstimmung') {
47-
const vResults = decision.comment.split(':');
47+
const voteResultsRegEx = /(\d{1,3}:\d{1,3}:\d{1,3})/;
48+
const vResults = decision.comment.match(voteResultsRegEx)[0].split(':');
4849
voteResults = {
4950
yes: vResults[0],
5051
no: vResults[1],

0 commit comments

Comments
 (0)