Skip to content

fix : added missing API call to deleteTask and replaced console.log/alert with console.error in useTasks - #2071

Open
tmdeveloper007 wants to merge 1 commit into
aryandas2911:mainfrom
tmdeveloper007:#2066
Open

fix : added missing API call to deleteTask and replaced console.log/alert with console.error in useTasks#2071
tmdeveloper007 wants to merge 1 commit into
aryandas2911:mainfrom
tmdeveloper007:#2066

Conversation

@tmdeveloper007

Copy link
Copy Markdown

Summary of What Has Been Done

  1. Added the missing api.delete(\/tasks/${id}`)call to thedeleteTaskfunction infrontend/src/hooks/useTasks.js`. Previously, the function only updated the UI optimistically but never actually deleted the task from the database.

  2. Replaced all console.log calls used for error logging with console.error in the getTasks, addTask, and updateTask error handlers.

  3. Replaced the alert() popup in addTask with console.error() since the error is already thrown and can be handled by the calling component.

Changes Made

  • frontend/src/hooks/useTasks.js: Added api.delete() call in deleteTask, replaced console.log with console.error, replaced alert() with console.error().

Impact it Made

  • Fixes the delete task functionality so tasks are actually removed from the backend database.
  • Ensures error conditions are properly logged as errors rather than info messages.
  • Removes intrusive browser alert popups from task creation.

Closes #2066
Closes #2069
Closes #2070

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

1 participant