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:
Daniël Klabbers 2019-02-18 08:43:47 +01:00
parent b36a58db10
commit 48064184a7

View File

@ -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;