mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 06:53:47 +08:00
Extract edit tag submit data for extensibility
This commit is contained in:
parent
6f9c6ea3dc
commit
6a363ef4f1
19
extensions/tags/js/admin/dist/extension.js
vendored
19
extensions/tags/js/admin/dist/extension.js
vendored
|
@ -768,6 +768,17 @@ System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal
|
|||
)
|
||||
);
|
||||
}
|
||||
}, {
|
||||
key: 'submitData',
|
||||
value: function submitData() {
|
||||
return {
|
||||
name: this.name(),
|
||||
slug: this.slug(),
|
||||
description: this.description(),
|
||||
color: this.color(),
|
||||
isHidden: this.isHidden()
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'onsubmit',
|
||||
value: function onsubmit(e) {
|
||||
|
@ -777,13 +788,7 @@ System.register('flarum/tags/components/EditTagModal', ['flarum/components/Modal
|
|||
|
||||
this.loading = true;
|
||||
|
||||
this.tag.save({
|
||||
name: this.name(),
|
||||
slug: this.slug(),
|
||||
description: this.description(),
|
||||
color: this.color(),
|
||||
isHidden: this.isHidden()
|
||||
}).then(function () {
|
||||
this.tag.save(this.submitData()).then(function () {
|
||||
return _this3.hide();
|
||||
}, function (response) {
|
||||
_this3.loading = false;
|
||||
|
|
|
@ -88,18 +88,22 @@ export default class EditTagModal extends Modal {
|
|||
);
|
||||
}
|
||||
|
||||
onsubmit(e) {
|
||||
e.preventDefault();
|
||||
|
||||
this.loading = true;
|
||||
|
||||
this.tag.save({
|
||||
submitData() {
|
||||
return {
|
||||
name: this.name(),
|
||||
slug: this.slug(),
|
||||
description: this.description(),
|
||||
color: this.color(),
|
||||
isHidden: this.isHidden()
|
||||
}).then(
|
||||
};
|
||||
}
|
||||
|
||||
onsubmit(e) {
|
||||
e.preventDefault();
|
||||
|
||||
this.loading = true;
|
||||
|
||||
this.tag.save(this.submitData()).then(
|
||||
() => this.hide(),
|
||||
response => {
|
||||
this.loading = false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user