DEV: make possible to pass both async and sync callbacks to the user status modal (#18712)
This commit is contained in:
parent
9dd431c272
commit
9129f18815
|
@ -157,8 +157,8 @@ export default Controller.extend(CanCheckEmails, {
|
|||
modalClass: "user-status",
|
||||
model: {
|
||||
status,
|
||||
saveAction: async (s) => this.set("newStatus", s),
|
||||
deleteAction: async () => this.set("newStatus", null),
|
||||
saveAction: (s) => this.set("newStatus", s),
|
||||
deleteAction: () => this.set("newStatus", null),
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
|
@ -52,8 +52,7 @@ export default Controller.extend(ModalFunctionality, {
|
|||
|
||||
@action
|
||||
delete() {
|
||||
this.model
|
||||
.deleteAction()
|
||||
Promise.resolve(this.model.deleteAction())
|
||||
.then(() => this.send("closeModal"))
|
||||
.catch((e) => this._handleError(e));
|
||||
},
|
||||
|
@ -71,8 +70,7 @@ export default Controller.extend(ModalFunctionality, {
|
|||
ends_at: this.status.endsAt?.toISOString(),
|
||||
};
|
||||
|
||||
this.model
|
||||
.saveAction(newStatus)
|
||||
Promise.resolve(this.model.saveAction(newStatus))
|
||||
.then(() => this.send("closeModal"))
|
||||
.catch((e) => this._handleError(e));
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue