From 1fc56f4ba44022d400bdba3edb4f27242a0a11d7 Mon Sep 17 00:00:00 2001 From: Lisa Cho Date: Fri, 12 Feb 2016 17:32:12 -0800 Subject: [PATCH] Add office display name to candidate page --- src/js/routes/Ballot/Candidate.jsx | 2 +- src/js/stores/BallotStore.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/routes/Ballot/Candidate.jsx b/src/js/routes/Ballot/Candidate.jsx index d404adc77..09392cf9f 100644 --- a/src/js/routes/Ballot/Candidate.jsx +++ b/src/js/routes/Ballot/Candidate.jsx @@ -97,7 +97,7 @@ export default class Candidate extends Component {
-
Running for US House - District 12
+
{ candidate.office_display_name }
diff --git a/src/js/stores/BallotStore.js b/src/js/stores/BallotStore.js index 871b2879f..e275272a8 100644 --- a/src/js/stores/BallotStore.js +++ b/src/js/stores/BallotStore.js @@ -225,6 +225,7 @@ const BallotStore = createStore({ BallotAPIWorker .candidatesRetrieve ( we_vote_id ) .then( (response) => { + var office_display_name = _ballot_store[response.office_we_vote_id]['ballot_item_display_name']; var cand_list = _ballot_store [ response.office_we_vote_id ] . candidate_list = []; @@ -235,6 +236,7 @@ const BallotStore = createStore({ var { we_vote_id: candidate_we_vote_id } = candidate; cand_list . push (candidate_we_vote_id); _ballot_store [ candidate_we_vote_id ] = shallowClone( candidate ); + _ballot_store [ candidate_we_vote_id ].office_display_name = office_display_name; promiseQueue .push (