equal
deleted
inserted
replaced
1 import RESTAdapter from 'ember-data/adapters/rest'; |
1 import RESTAdapter from 'ember-data/adapters/rest'; |
2 import ENV from 'app-client/config/environment'; |
2 import ENV from 'app-client/config/environment'; |
|
3 |
|
4 const TYPE_PATH_MAP = { |
|
5 transcript: 'transcript', |
|
6 geostat: 'stats/geostats', |
|
7 theme: 'stats/themes' |
|
8 }; |
3 |
9 |
4 export default RESTAdapter.extend({ |
10 export default RESTAdapter.extend({ |
5 |
11 |
6 namespace: ENV.rootURL.replace(/\/$/,"")+'/api/v1', |
12 namespace: ENV.rootURL.replace(/\/$/,"")+'/api/v1', |
7 |
13 |
11 } |
17 } |
12 return this._super(...arguments); |
18 return this._super(...arguments); |
13 }, |
19 }, |
14 |
20 |
15 pathForType: function(modelName) { |
21 pathForType: function(modelName) { |
16 if(modelName === 'transcript') { |
22 return TYPE_PATH_MAP[modelName] || this._super(...arguments); |
17 return modelName; |
|
18 } |
|
19 return this._super(...arguments); |
|
20 } |
23 } |
21 |
24 |
22 }); |
25 }); |