Add error handling to edit group modal

This commit is contained in:
Toby Zerner 2015-10-19 15:44:00 +10:30
parent ed4be20be2
commit a74c4ebd71

View File

@ -65,7 +65,7 @@ export default class EditGroupModal extends Modal {
children: app.trans('core.admin.edit_group_submit_button')
})}
{this.group.exists && this.group.id() !== Group.ADMINISTRATOR_ID ? (
<button type="button" className="Button EditGroupModal-delete" onclick={this.delete.bind(this)}>
<button type="button" className="Button EditGroupModal-delete" onclick={this.deleteGroup.bind(this)}>
{app.trans('core.admin.edit_group_delete_button')}
</button>
) : ''}
@ -87,14 +87,14 @@ export default class EditGroupModal extends Modal {
icon: this.icon()
}).then(
() => this.hide(),
() => {
(response) => {
this.loading = false;
m.redraw();
this.handleErrors(response);
}
);
}
delete() {
deleteGroup() {
if (confirm(app.trans('core.admin.edit_group_delete_confirmation'))) {
this.group.delete().then(() => m.redraw());
this.hide();