change column name from 'city' to 'region'

This commit is contained in:
Bilal Catic
2019-05-17 00:33:10 +02:00
parent 42505a7089
commit 4309bc709d
7 changed files with 49 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
const geographies = [
const regions = [
{
"ime":" Sarajevo",
"id":"sarajevo",
@@ -872,12 +872,12 @@ const geographies = [
}
];
const regions = () => {
return geographies.map( (g) => ({ ime: g.ime, id: g.id, olxid: g.olxid }) );
const getRegions = () => {
return regions.map( (g) => ({ ime: g.ime, id: g.id, olxid: g.olxid }) );
};
const getMunicipalitiesForRegion = (regionId) => {
for (geo of geographies) {
for (geo of regions) {
if(geo.id === regionId) {
return geo.mjesta;
}
@@ -886,6 +886,6 @@ const getMunicipalitiesForRegion = (regionId) => {
};
module.exports = {
regions,
getRegions,
getMunicipalitiesForRegion
};