mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
update: common/Model (use body instead of data on m.request)
This commit is contained in:
committed by
Franz Liedke
parent
1e9825de4f
commit
98740472a8
@@ -161,7 +161,7 @@ export default class Model {
|
||||
{
|
||||
method: this.exists ? 'PATCH' : 'POST',
|
||||
url: app.forum.attribute('apiUrl') + this.apiEndpoint(),
|
||||
data: request,
|
||||
body: request,
|
||||
},
|
||||
options
|
||||
)
|
||||
@@ -189,12 +189,12 @@ export default class Model {
|
||||
/**
|
||||
* Send a request to delete the resource.
|
||||
*
|
||||
* @param {Object} data Data to send along with the DELETE request.
|
||||
* @param {Object} body Data to send along with the DELETE request.
|
||||
* @param {Object} [options]
|
||||
* @return {Promise}
|
||||
* @public
|
||||
*/
|
||||
delete(data, options = {}) {
|
||||
delete(body, options = {}) {
|
||||
if (!this.exists) return m.deferred().resolve().promise;
|
||||
|
||||
return app
|
||||
@@ -203,7 +203,7 @@ export default class Model {
|
||||
{
|
||||
method: 'DELETE',
|
||||
url: app.forum.attribute('apiUrl') + this.apiEndpoint(),
|
||||
data,
|
||||
body,
|
||||
},
|
||||
options
|
||||
)
|
||||
|
Reference in New Issue
Block a user