1
0
mirror of https://github.com/flarum/core.git synced 2025-05-12 18:35:23 +02:00

Update js/src/common/Model.ts

Co-authored-by: David Wheatley <hi@davwheat.dev>
This commit is contained in:
Alexander Skvortsov 2021-12-12 14:55:38 -05:00 committed by Alexander Skvortsov
parent 0bdb018ad4
commit 44efff342d
No known key found for this signature in database
GPG Key ID: C4E3BBF9C3412B4C

View File

@ -204,14 +204,12 @@ export default abstract class Model {
return app return app
.request<ApiPayloadSingle>( .request<ApiPayloadSingle>(
Object.assign(
{ {
method: this.exists ? 'PATCH' : 'POST', method: this.exists ? 'PATCH' : 'POST',
url: app.forum.attribute('apiUrl') + this.apiEndpoint(), url: app.forum.attribute('apiUrl') + this.apiEndpoint(),
body: request, body: request,
...options,
}, },
options
)
) )
.then( .then(
// If everything went well, we'll make sure the store knows that this // If everything went well, we'll make sure the store knows that this