Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
Fix continents iso_code path
Browse files Browse the repository at this point in the history
  • Loading branch information
j8seangel committed Feb 9, 2018
1 parent f0ab75b commit 66402b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ define(
},

onContinentsData(continentsData) {
var continents = _.map(continentsData, function(c) {
c.href = '/countries/' + c.iso + '/report';
return c;
});
this.continentsView = new GeoListView({
el: this.continentsEl,
data: continentsData,
data: continents,
placeholder: 'Type continent name'
});
this.continentsEl.removeClass('is-loading');
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/services/ContinentService.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ define(

var APIURLS = {
getContinentsList:
'/query?sql=SELECT continent FROM {continentsDataset} where climate=true',
'/query?sql=SELECT continent, iso_code FROM {continentsDataset} where climate=true',
getContinentsListGeo:
'/query?sql=SELECT topojson, continent FROM {continentsDataset} where climate=true'
'/query?sql=SELECT topojson, continent, iso_code FROM {continentsDataset} where climate=true'
};

var ContinentsService = Class.extend({
Expand Down Expand Up @@ -52,7 +52,7 @@ define(
var dataParsed = data.map(function(continent) {
return {
name: continent.continent,
iso: continent.continent.split(' ').join('-'),
iso: continent.iso_code,
topojson: continent.topojson
};
});
Expand Down

0 comments on commit 66402b3

Please sign in to comment.