cms/app-client/app/adapters/application.js
changeset 245 c9dd78a43b07
parent 126 e87a340711a4
child 261 02e2396bcbbc
--- a/cms/app-client/app/adapters/application.js	Mon Jul 18 02:37:48 2016 +0200
+++ b/cms/app-client/app/adapters/application.js	Wed Jul 20 21:08:31 2016 +0200
@@ -2,14 +2,21 @@
 import ENV from 'app-client/config/environment';
 
 export default RESTAdapter.extend({
-  namespace: ENV.baseURL.replace(/\/$/,"")+'/api/v1',
-  //TODO: pass this as configuration
-  //host: 'http://localhost:8000'
-});
+
+    namespace: ENV.baseURL.replace(/\/$/,"")+'/api/v1',
 
-//export { default } from 'ember-data-fixture-adapter';
+    buildURL: function(modelName, id) {
+        if(modelName === 'transcript') {
+            return this.urlPrefix() + '/documents/' + id + '/' + modelName;
+        }
+        return this._super(...arguments);
+    },
 
-// export default DS.RESTAdapter.extend({
-//   host: 'http://127.0.0.1:8000',
-//   namespace: 'api',
-// });
+    pathForType: function(modelName) {
+        if(modelName === 'transcript') {
+            return modelName;
+        }
+        return this._super(...arguments);
+    }
+
+});
\ No newline at end of file