Browse Source

failing API calls now display errors using the toast

gh-pages
Keviin Åberg Kultalahti 6 years ago
parent
commit
37c2b51095
  1. 3
      packages/client/src/api/api.js

3
packages/client/src/api/api.js

@ -1,3 +1,5 @@
import { notificationStore } from "../store/notification"
/**
* API cache for cached request responses.
*/
@ -7,6 +9,7 @@ let cache = {}
* Handler for API errors.
*/
const handleError = error => {
notificationStore.danger(error)
return { error }
}

Loading…
Cancel
Save