cms/app-client/app/adapters/application.js
author ymh <ymh.work@gmail.com>
Sat, 06 Aug 2016 21:27:53 +0700
changeset 260 64caee7ce38d
parent 245 c9dd78a43b07
child 261 02e2396bcbbc
permissions -rw-r--r--
Split document model in document and document results

import RESTAdapter from 'ember-data/adapters/rest';
import ENV from 'app-client/config/environment';

export default RESTAdapter.extend({

    namespace: ENV.baseURL.replace(/\/$/,"")+'/api/v1',

    buildURL: function(modelName, id) {
        if(modelName === 'transcript') {
            return this.urlPrefix() + '/documents/' + id + '/' + modelName;
        }
        return this._super(...arguments);
    },

    pathForType: function(modelName) {
        if(modelName === 'transcript') {
            return modelName;
        }
        return this._super(...arguments);
    }

});