Skip to content

Commit

Permalink
fix: snackbar colors for http status 2xx
Browse files Browse the repository at this point in the history
  • Loading branch information
tympanix committed Jun 28, 2018
1 parent 861ee15 commit b037b5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ class Api {

showError(res) {
if (res.data.error && typeof res.data.error === 'string') {
if (res.status < 400) {
if (res.status < 300) {
Snackbar.success("Success", res.data.error)
} else if (res.status < 400) {
Snackbar.warning("Warning", res.data.error)
} else {
Snackbar.error("Error", res.data.error)
Expand Down

0 comments on commit b037b5a

Please sign in to comment.