mirror of
https://github.com/flarum/framework.git
synced 2025-02-28 09:12:10 +08:00
Fixes an issue where deleting a nonexistent model would error instead of resolving gracefully
This commit is contained in:
parent
c4806e19b5
commit
5530422210
@ -190,7 +190,7 @@ export default class Model {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
delete(data, options = {}) {
|
delete(data, options = {}) {
|
||||||
if (!this.exists) return m.deferred.resolve().promise;
|
if (!this.exists) return m.deferred().resolve().promise;
|
||||||
|
|
||||||
return app.request(Object.assign({
|
return app.request(Object.assign({
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user