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;
}
submitData() {
return {
nameSingular: this.nameSingular(),
namePlural: this.namePlural(),
color: this.color(),
icon: this.icon()
};
}
onsubmit(e) {
e.preventDefault();
this.loading = true;
this.group.save({
nameSingular: this.nameSingular(),
namePlural: this.namePlural(),
color: this.color(),
icon: this.icon()
}, {errorHandler: this.onerror.bind(this)})
this.group.save(this.submitData(), {errorHandler: this.onerror.bind(this)})
.then(this.hide.bind(this))
.catch(() => {
this.loading = false;