mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
DEV: Avoid using the old action helper (#26935)
This commit is contained in:
@ -15,16 +15,16 @@ export default class AutomationNew extends Controller {
|
||||
}
|
||||
|
||||
@action
|
||||
saveAutomation(automation) {
|
||||
saveAutomation() {
|
||||
this.set("error", null);
|
||||
|
||||
automation
|
||||
this.model.automation
|
||||
.save(this.form.getProperties("name", "script"))
|
||||
.then(() => {
|
||||
this._resetForm();
|
||||
this.router.transitionTo(
|
||||
"adminPlugins.discourse-automation.edit",
|
||||
automation.id
|
||||
this.model.automation.id
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
@ -27,7 +27,7 @@
|
||||
<DropdownSelectBox
|
||||
@value={{form.script}}
|
||||
@content={{model.scriptables.content}}
|
||||
@onChange={{action (mut form.script)}}
|
||||
@onChange={{fn (mut form.script)}}
|
||||
@options={{hash
|
||||
showCaret=true
|
||||
filterable=true
|
||||
@ -39,12 +39,11 @@
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
|
||||
<div class="controls">
|
||||
<DButton
|
||||
@icon="plus"
|
||||
@label="discourse_automation.create"
|
||||
@action={{action "saveAutomation" model.automation}}
|
||||
@action={{this.saveAutomation}}
|
||||
class="btn-primary create-automation"
|
||||
/>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user