From 73b2a775aa690282bb0c03a1e0a52b9eadcc141c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 22 Jan 2021 13:27:13 +0100 Subject: [PATCH] failing API calls now display errors using the toast --- packages/client/src/api/api.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/client/src/api/api.js b/packages/client/src/api/api.js index 1e73baf602..e0e3a78534 100644 --- a/packages/client/src/api/api.js +++ b/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 } }