diff --git a/frontend/src/hooks/useTasks.js b/frontend/src/hooks/useTasks.js index 4cd7d700..f3e338fd 100644 --- a/frontend/src/hooks/useTasks.js +++ b/frontend/src/hooks/useTasks.js @@ -52,7 +52,7 @@ const useTasks = ({ limit: data.limit || initialLimit, }); } catch (error) { - console.log(error?.response?.data?.message || "Failed to load tasks"); + setTasks([]); } finally { setLoading(false); @@ -66,7 +66,7 @@ const useTasks = ({ try { const response = await api.post("/tasks", taskData); - console.log("Task added:", response.data); + invalidateTasks(); @@ -76,12 +76,7 @@ const useTasks = ({ setPage(DEFAULT_PAGE); } } catch (error) { - console.log("FULL ERROR:", error); - console.log( - error?.response?.data?.message || - error?.response?.data || - error.message, - ); + alert(error?.response?.data?.message || "Failed to create task"); throw error; } diff --git a/frontend/src/pages/Login.jsx b/frontend/src/pages/Login.jsx index d22fa0f1..b80fd2a7 100644 --- a/frontend/src/pages/Login.jsx +++ b/frontend/src/pages/Login.jsx @@ -90,7 +90,8 @@ const Login = () => { setUser(res.data.user); navigate(redirectPath, { replace: true }); } catch (err) { - console.error(err); + console.error("Google login failed", err); + setError( err.response?.data?.message ||