client/views: move notifications to controllers

This commit is contained in:
rr-
2016-04-08 13:17:00 +02:00
parent 0ceaa8da42
commit 5bd7f1fa6c
7 changed files with 44 additions and 40 deletions

View File

@ -72,11 +72,13 @@ class UsersController {
resolve();
page('/');
events.notify(events.Success, 'Welcome aboard!');
}).catch(response => {
reject(response.description);
}).catch(errorMessage => {
reject();
events.notify(events.Error, errorMessage);
});
}).catch(response => {
reject(response.description);
reject();
events.notify(events.Error, response.description);
});
});
}
@ -103,10 +105,9 @@ class UsersController {
newPassword || api.userPassword,
false)
.then(next)
.catch(response => {
.catch(errorMessage => {
reject();
events.notify(
events.Error, response.description);
events.notify(events.Error, errorMessage);
});
} else {
next();