Skip to content

Commit

Permalink
Prevent errors after submit
Browse files Browse the repository at this point in the history
  • Loading branch information
josephspurrier committed Mar 29, 2020
1 parent 4b2d42b commit 2c3cd92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/app/api/static/app/src/page/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ function onsubmit(e) {

Cookie.set("auth", auth);

Submit.finish();
m.route.set("/list");
})
.catch((err) => {
Submit.finish();
console.log(err);
alert(err.response.message);
})
.finally(function () {
Submit.finish();
});
});
}
Expand Down
5 changes: 2 additions & 3 deletions src/app/api/static/app/src/page/Register.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ function onsubmit(e) {
User.register()
.then(() => {
User.clear();
Submit.finish();
m.route.set("/login");
})
.catch((err) => {
alert(err.response.message);
})
.finally(function () {
Submit.finish();
alert(err.response.message);
});
});
}
Expand Down

0 comments on commit 2c3cd92

Please sign in to comment.