diff options
| author | Pitu <[email protected]> | 2019-04-24 08:36:28 +0000 |
|---|---|---|
| committer | Pitu <[email protected]> | 2019-04-24 08:36:28 +0000 |
| commit | 3bd8d119ba88e940932eca50be406d50d73040fb (patch) | |
| tree | 9d24cdfc1edc53cce6670ffabb60597636571ecd /src/site/pages/register.vue | |
| parent | Get rid of the icons altogether in a future commit (diff) | |
| download | host.fuwn.me-3bd8d119ba88e940932eca50be406d50d73040fb.tar.xz host.fuwn.me-3bd8d119ba88e940932eca50be406d50d73040fb.zip | |
Refactor a bit since we globally catch API exceptions
Diffstat (limited to 'src/site/pages/register.vue')
| -rw-r--r-- | src/site/pages/register.vue | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/site/pages/register.vue b/src/site/pages/register.vue index bb17298..b780ec2 100644 --- a/src/site/pages/register.vue +++ b/src/site/pages/register.vue @@ -5,7 +5,7 @@ <template> <section id="register" class="hero is-fullheight"> - <Navbar/> + <Navbar /> <div class="hero-body"> <div class="container"> <h1 class="title"> @@ -75,7 +75,10 @@ export default { async register() { if (this.isLoading) return; if (this.password !== this.rePassword) { - this.$showToast('Passwords don\'t match', true); + this.$store.dispatch('alert', { + text: 'Passwords don\'t match', + error: true + }); return; } this.isLoading = true; @@ -85,10 +88,11 @@ export default { username: this.username, password: this.password }); - this.$showToast(response.message); + + this.$store.dispatch('alert', { text: response.message }); return this.$router.push('/login'); } catch (error) { - this.$onPromiseError(error); + // } finally { this.isLoading = false; } |