mirror of
https://github.com/flarum/framework.git
synced 2025-02-28 16:44:28 +08:00
Copied over logic from EditTagModal to allow additional attributes to be send
to the API based on additional fields rendered by extending the fields.
This commit is contained in:
parent
b36a58db10
commit
48064184a7
@ -84,17 +84,21 @@ export default class EditGroupModal extends Modal {
|
|||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
submitData() {
|
||||||
|
return {
|
||||||
|
nameSingular: this.nameSingular(),
|
||||||
|
namePlural: this.namePlural(),
|
||||||
|
color: this.color(),
|
||||||
|
icon: this.icon()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
onsubmit(e) {
|
onsubmit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
this.group.save({
|
this.group.save(this.submitData(), {errorHandler: this.onerror.bind(this)})
|
||||||
nameSingular: this.nameSingular(),
|
|
||||||
namePlural: this.namePlural(),
|
|
||||||
color: this.color(),
|
|
||||||
icon: this.icon()
|
|
||||||
}, {errorHandler: this.onerror.bind(this)})
|
|
||||||
.then(this.hide.bind(this))
|
.then(this.hide.bind(this))
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user