cms/app-client/app/adapters/application.js
changeset 314 f5690d918358
parent 306 3fccf43160a7
child 318 5564f5065f81
--- a/cms/app-client/app/adapters/application.js	Sun Oct 02 19:11:06 2016 +0200
+++ b/cms/app-client/app/adapters/application.js	Sun Oct 02 19:14:07 2016 +0200
@@ -1,6 +1,12 @@
 import RESTAdapter from 'ember-data/adapters/rest';
 import ENV from 'app-client/config/environment';
 
+const TYPE_PATH_MAP = {
+    transcript: 'transcript',
+    geostat: 'stats/geostats',
+    theme: 'stats/themes'
+};
+
 export default RESTAdapter.extend({
 
     namespace: ENV.rootURL.replace(/\/$/,"")+'/api/v1',
@@ -13,10 +19,7 @@
     },
 
     pathForType: function(modelName) {
-        if(modelName === 'transcript') {
-            return modelName;
-        }
-        return this._super(...arguments);
+        return TYPE_PATH_MAP[modelName] || this._super(...arguments);
     }
 
 });