Skip to content

Commit

Permalink
Updated "get" in service.js to always include the voter_device_id wit…
Browse files Browse the repository at this point in the history
…h all endpoint calls. Added GuidePositionList back to Root.jsx
  • Loading branch information
DaleMcGrew committed Feb 18, 2016
1 parent d3d4847 commit ea15baf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/js/Root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import Candidate from "./routes/Ballot/Candidate";

/* Ballot Off-shoot Pages */
import Opinions from "./routes/Opinions";
import GuidePositionList from './routes/Guide/PositionList'; // A list of all positions from one guide

/* More */
import More from "./routes/More";
Expand Down Expand Up @@ -73,6 +74,9 @@ const routes = (firstVisit, voter) =>
<Route path="/more/opinions/followed" component={OpinionsFollowed} />
<Route path="/more/privacy" component={Privacy} />

{/* Voter Guide Pages */}
<Route path="/guidepositions/:we_vote_id" component={GuidePositionList} />

{ firstVisit ? <IndexRoute component={Intro} /> : <IndexRedirect to="ballot" /> }

<Route path="ballot" component={BallotIndex}>
Expand Down
6 changes: 5 additions & 1 deletion src/js/utils/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export function get (options) {
var opts = assign(defaults, options);

opts.url = url.resolve(opts.baseUrl, opts.endpoint);
// We add voter_device_id to all endpoint calls
opts.query["voter_device_id"] = cookies.getItem("voter_device_id");

return new Promise( (resolve, reject) => new request.Request("GET", opts.url)
.accept(opts.dataType)
Expand Down Expand Up @@ -112,7 +114,9 @@ export function candidatesRetrieve (office_we_vote_id, success ) {

// get the ballot items
export function voterBallotItemsRetrieve (success) {
return get({ endpoint: "voterBallotItemsRetrieve", success });
return get({
endpoint: "voterBallotItemsRetrieve",
success });
}

export function positionOpposeCountForBallotItem (id, kind_of_ballot_item, success ) {
Expand Down

0 comments on commit ea15baf

Please # to comment.