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'),
|
||||
});
|
||||
this._view.addEventListener('submit', e => this._evtSubmit(e));
|
||||
}, response => {
|
||||
}, errorMessage => {
|
||||
this._view = new EmptyView();
|
||||
this._view.showError(response.description);
|
||||
this._view.showError(errorMessage);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -60,8 +60,8 @@ class TagController {
|
|||
e.detail.tag.save().then(() => {
|
||||
this._view.showSuccess('Tag saved.');
|
||||
this._view.enableForm();
|
||||
}, response => {
|
||||
this._view.showError(response.description);
|
||||
}, errorMessage => {
|
||||
this._view.showError(errorMessage);
|
||||
this._view.enableForm();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ class UserController {
|
|||
ctx.controller.showSuccess('Account deleted.');
|
||||
}
|
||||
}, errorMessage => {
|
||||
this._view.showError(response.description);
|
||||
this._view.showError(errorMessage);
|
||||
this._view.enableForm();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@ class UserRegistrationController {
|
|||
user.save().then(() => {
|
||||
api.forget();
|
||||
return api.login(e.detail.name, e.detail.password, false);
|
||||
}, response => {
|
||||
return Promise.reject(response.description);
|
||||
}, errorMessage => {
|
||||
return Promise.reject(errorMessage);
|
||||
}).then(() => {
|
||||
const ctx = router.show('/');
|
||||
ctx.controller.showSuccess('Welcome aboard!');
|
||||
|
|
Loading…
Reference in a new issue