Skip to content

Commit

Permalink
Merge pull request #709 from DemocracyClub/prefixes20241204
Browse files Browse the repository at this point in the history
add dots to id prefixes
  • Loading branch information
chris48s authored Dec 5, 2024
2 parents fbdae9b + fed86b5 commit 9fbab9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Ballot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import BallotInfo from './BallotInfo';
function Ballot(props) {
const ballot = props.ballot;
const candidatesVerified = ballot.candidates.length > 1 && ballot.candidates_verified;
const isConstituency = ['parl', 'nia', 'gla.c', 'senedd.c', 'sp.c'].some((prefix) =>
const isConstituency = ['parl.', 'nia.', 'gla.c.', 'senedd.c.', 'sp.c.'].some((prefix) =>
ballot.ballot_paper_id.startsWith(prefix)
);
const isRegion = ['senedd.r.', 'sp.r.'].some((prefix) =>
ballot.ballot_paper_id.startsWith(prefix)
);
const isRegion = ['senedd.r', 'sp.r'].some((prefix) => ballot.ballot_paper_id.startsWith(prefix));
let divisionType = '';
if (isConstituency) {
divisionType = 'Constituency';
Expand Down

0 comments on commit 9fbab9c

Please sign in to comment.