Skip to content

fix : removed console.log statements from useTasks hook - #2026

Open
tmdeveloper007 wants to merge 3 commits into
aryandas2911:mainfrom
tmdeveloper007:#2021
Open

fix : removed console.log statements from useTasks hook#2026
tmdeveloper007 wants to merge 3 commits into
aryandas2911:mainfrom
tmdeveloper007:#2021

Conversation

@tmdeveloper007

Copy link
Copy Markdown

Summary of What Has Been Done

The useTasks.js hook contained debug console.log statements that were leaking internal state to the browser console. These have been removed as the error handling is already done via the onError callback and alert notifications.

Changes Made

  1. frontend/src/hooks/useTasks.js:
    • Removed console.log(error?.response?.data?.message || "Failed to load tasks") in getTasks catch block (error is handled elsewhere)
    • Removed console.log("Task added:", response.data) in addTask (the task is already added to state via getTasks)
    • Removed console.log("FULL ERROR:", error) and related console.log calls in addTask catch block (error is already shown via alert)
    • Removed console.log(error?.response?.data?.message || "Failed to update task") in updateTask catch block
    • Cleaned up unused error and response variable declarations to satisfy linting

Impact it Made

  • Cleaner browser console output in production environments
  • Reduced noise in developer tools
  • Error handling already uses alert/toast notifications, making the console.log statements redundant

Closes #2021

Note: Please assign this PR to the tmdeveloper007 account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : remove console.log statements from useTasks hook

1 participant