equal
deleted
inserted
replaced
|
1 import * as constants from 'corpus-common-addon/utils/constants'; |
|
2 |
|
3 import ResolverService from 'corpus-common-addon/services/resolver-service'; |
|
4 |
|
5 export default ResolverService.extend({ |
|
6 |
|
7 storeKeyBase: 'geonames', |
|
8 apiPath: '/api/v1/geonames/', |
|
9 resDocRoot: 'geonamesids', |
|
10 |
|
11 init() { |
|
12 this._super(...arguments); |
|
13 }, |
|
14 |
|
15 processId: function(id) { |
|
16 var geonamesId = id; |
|
17 var m = id.match(constants.GEONAMES_BASE_URLS); |
|
18 if (m) { |
|
19 geonamesId = id.slice(m[0].length); |
|
20 } |
|
21 return geonamesId.replace(/\/+$/, ''); |
|
22 }, |
|
23 |
|
24 getReturnDictKey: function(id) { return id; }, |
|
25 |
|
26 getLabel: function(id) { return this.getName(id); } |
|
27 |
|
28 }); |