cms/app-client/app/adapters/application.js
changeset 339 766af1228b05
parent 319 78990a8a069b
child 393 5ef3bfef0bff
--- a/cms/app-client/app/adapters/application.js	Sun Oct 16 22:23:31 2016 +0530
+++ b/cms/app-client/app/adapters/application.js	Sun Oct 16 23:19:57 2016 +0530
@@ -9,11 +9,13 @@
 
 export default RESTAdapter.extend({
 
-    namespace: ENV.rootURL.replace(/\/$/,"")+'/api/v1',
+    namespace: (ENV.APP.backRootURL || ENV.rootURL).replace(/\/$/,"")+'/api/v1',
 
     buildURL: function(modelName, id) {
         if(modelName === 'transcript') {
-            return this.urlPrefix() + '/documents/' + id + '/' + modelName;
+            return this.urlPrefix() + '/documents/' + encodeURIComponent(encodeURIComponent(id)) + '/' + modelName;
+        } else if (modelName === 'document' && id) {
+            return this.urlPrefix() + '/documents/' + encodeURIComponent(encodeURIComponent(id)) ;
         }
         return this._super(...arguments);
     },