import OsfAdapter from './osf-adapter';

export default OsfAdapter.extend({
    namespace: '_/chronos',
    urlForQuery: function (query) {
        const url = `${this.host}/${this.namespace}/${query.preprintId}/submissions/`;
        delete query.preprintId;
        return url;
    },

    urlForCreateRecord: function (modelname, snapshot) {
        const preprintId = snapshot.belongsTo('preprint').id;
        const url = `${this.host}/${this.namespace}/${preprintId}/submissions/`;
        return url;
    }
});

@@ -497,22 +497,674 @@
 return url;%0A
+    %7D,%0A%0A    urlForUpdateRecord: function (id, modelName, snapshot) %7B%0A        const preprintId = snapshot.belongsTo('preprint').id;%0A        const submissionId = snapshot.id;%0A        const url = %60$%7Bthis.host%7D/$%7Bthis.namespace%7D/$%7BpreprintId%7D/submissions/$%7BsubmissionId%7D%60;%0A        return url;%0A    %7D,%0A%0A    updateRecord: function (store, type, snapshot) %7B%0A        let data = %7B%7D;%0A        let serializer = store.serializerFor(type.modelName);%0A        serializer.serializeIntoHash(data, type, snapshot);%0A        let id = snapshot.id;%0A        let url = this.buildURL(type.modelName, id, snapshot, 'updateRecord');%0A        return this.ajax(url, %22PUT%22, %7B data %7D);%0A
     %7D%0A%7D);%0A

change chronos-submission adapter