From 73b7786d1a3472cd56ad70c22e56aa6ef0e813fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Viricel?= Date: Mon, 7 Dec 2020 19:11:32 +0100 Subject: [PATCH] Remove console statements --- README.md | 3 ++- src/store/actions.js | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7400cb2..5980bdc 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,8 @@ You've been given the task of creating a simple application with create/read/del - Setup API proxy with Axios - More Accessibility - Component Lazy Loading - - Inject axios globally as $http. + - Image Caching & Lazy Loading + - Inject axios globally as $http - More test ### How much time (more or less) it took you to complete the task? diff --git a/src/store/actions.js b/src/store/actions.js index 9a1d4ca..6eb6afe 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -20,7 +20,9 @@ export default { await axios .post("http://localhost:3000/fruit", fruit) .then(res => commit("addFruit", res.data)) - .catch(err => console.log(err)) + .catch(err => { + throw new Error(err.message); + }) .finally(() => commit("setLoading", false)); }, removeFruit: async ({ commit }, id) => { @@ -30,7 +32,9 @@ export default { commit("removeFruit", id); commit("toggleDeleteMode"); }) - .catch(err => console.log(err)); + .catch(err => { + throw new Error(err.message); + }); }, getImageFromUnsplash: async ({ commit }, keyword) => { commit("setLoading", true);