client/general: fix certain error handlers
This commit is contained in:
parent
c7f6663c36
commit
2f20bc1619
4 changed files with 7 additions and 7 deletions
|
@ -22,9 +22,9 @@ class TagCategoriesController {
|
||||||
canSetDefault: api.hasPrivilege('tagCategories:setDefault'),
|
canSetDefault: api.hasPrivilege('tagCategories:setDefault'),
|
||||||
});
|
});
|
||||||
this._view.addEventListener('submit', e => this._evtSubmit(e));
|
this._view.addEventListener('submit', e => this._evtSubmit(e));
|
||||||
}, response => {
|
}, errorMessage => {
|
||||||
this._view = new EmptyView();
|
this._view = new EmptyView();
|
||||||
this._view.showError(response.description);
|
this._view.showError(errorMessage);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,8 @@ class TagController {
|
||||||
e.detail.tag.save().then(() => {
|
e.detail.tag.save().then(() => {
|
||||||
this._view.showSuccess('Tag saved.');
|
this._view.showSuccess('Tag saved.');
|
||||||
this._view.enableForm();
|
this._view.enableForm();
|
||||||
}, response => {
|
}, errorMessage => {
|
||||||
this._view.showError(response.description);
|
this._view.showError(errorMessage);
|
||||||
this._view.enableForm();
|
this._view.enableForm();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,7 @@ class UserController {
|
||||||
ctx.controller.showSuccess('Account deleted.');
|
ctx.controller.showSuccess('Account deleted.');
|
||||||
}
|
}
|
||||||
}, errorMessage => {
|
}, errorMessage => {
|
||||||
this._view.showError(response.description);
|
this._view.showError(errorMessage);
|
||||||
this._view.enableForm();
|
this._view.enableForm();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,8 @@ class UserRegistrationController {
|
||||||
user.save().then(() => {
|
user.save().then(() => {
|
||||||
api.forget();
|
api.forget();
|
||||||
return api.login(e.detail.name, e.detail.password, false);
|
return api.login(e.detail.name, e.detail.password, false);
|
||||||
}, response => {
|
}, errorMessage => {
|
||||||
return Promise.reject(response.description);
|
return Promise.reject(errorMessage);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
const ctx = router.show('/');
|
const ctx = router.show('/');
|
||||||
ctx.controller.showSuccess('Welcome aboard!');
|
ctx.controller.showSuccess('Welcome aboard!');
|
||||||
|
|
Loading…
Reference in a new issue