cms/app-client/app/adapters/application.js
changeset 339 766af1228b05
parent 319 78990a8a069b
child 393 5ef3bfef0bff
equal deleted inserted replaced
338:4a3899b6a7ed 339:766af1228b05
     7     theme: 'stats/themes'
     7     theme: 'stats/themes'
     8 };
     8 };
     9 
     9 
    10 export default RESTAdapter.extend({
    10 export default RESTAdapter.extend({
    11 
    11 
    12     namespace: ENV.rootURL.replace(/\/$/,"")+'/api/v1',
    12     namespace: (ENV.APP.backRootURL || ENV.rootURL).replace(/\/$/,"")+'/api/v1',
    13 
    13 
    14     buildURL: function(modelName, id) {
    14     buildURL: function(modelName, id) {
    15         if(modelName === 'transcript') {
    15         if(modelName === 'transcript') {
    16             return this.urlPrefix() + '/documents/' + id + '/' + modelName;
    16             return this.urlPrefix() + '/documents/' + encodeURIComponent(encodeURIComponent(id)) + '/' + modelName;
       
    17         } else if (modelName === 'document' && id) {
       
    18             return this.urlPrefix() + '/documents/' + encodeURIComponent(encodeURIComponent(id)) ;
    17         }
    19         }
    18         return this._super(...arguments);
    20         return this._super(...arguments);
    19     },
    21     },
    20 
    22 
    21     pathForType: function(modelName) {
    23     pathForType: function(modelName) {