mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Make sure super in buildURL passes all arguments
This commit is contained in:
parent
1c3354c51a
commit
6659ecc6b6
2 changed files with 6 additions and 6 deletions
|
@ -26,9 +26,9 @@ export default RESTAdapter.extend({
|
|||
return this.ajax(this.buildURL(type.modelName, id), 'GET', {data: query});
|
||||
},
|
||||
|
||||
buildURL(type, id) {
|
||||
buildURL() {
|
||||
// Ensure trailing slashes
|
||||
let url = this._super(type, id);
|
||||
let url = this._super(...arguments);
|
||||
|
||||
if (url.slice(-1) !== '/') {
|
||||
url += '/';
|
||||
|
|
|
@ -43,7 +43,7 @@ export default BaseAdapter.extend({
|
|||
},
|
||||
|
||||
createRecord(store, type, snapshot) {
|
||||
return this.saveRecord(store, type, snapshot, {method: 'POST'});
|
||||
return this.saveRecord(store, type, snapshot, {method: 'POST'}, 'createRecord');
|
||||
},
|
||||
|
||||
updateRecord(store, type, snapshot) {
|
||||
|
@ -52,12 +52,12 @@ export default BaseAdapter.extend({
|
|||
id: get(snapshot, 'id')
|
||||
};
|
||||
|
||||
return this.saveRecord(store, type, snapshot, options);
|
||||
return this.saveRecord(store, type, snapshot, options, 'updateRecord');
|
||||
},
|
||||
|
||||
saveRecord(store, type, snapshot, options) {
|
||||
saveRecord(store, type, snapshot, options, requestType) {
|
||||
let _options = options || {};
|
||||
let url = this.buildIncludeURL(store, type.modelName, _options.id, snapshot, 'createRecord');
|
||||
let url = this.buildIncludeURL(store, type.modelName, _options.id, snapshot, requestType);
|
||||
let payload = this.preparePayload(store, type, snapshot);
|
||||
|
||||
return this.ajax(url, _options.method, payload);
|
||||
|
|
Loading…
Add table
Reference in a new issue