Skip to content

fix: block task deletion if task is referenced in saved routines#708

Open
abhigyan24-ops wants to merge 3 commits into
aryandas2911:mainfrom
abhigyan24-ops:fix/dangling-task-references
Open

fix: block task deletion if task is referenced in saved routines#708
abhigyan24-ops wants to merge 3 commits into
aryandas2911:mainfrom
abhigyan24-ops:fix/dangling-task-references

Conversation

@abhigyan24-ops
Copy link
Copy Markdown

Summary

Closes #91

Changes

  • Added Routine import to taskController.js
  • In deleteTask: checks if the task is used in any routine before deleting — returns 409 with routine names if blocked
  • In bulkDeleteTasks: same check for bulk deletion

Testing

  1. Create a task and add it to a saved routine
  2. Try to delete that task from the Tasks page
  3. Error message shows: "Cannot delete task — it is used in N routine(s): [name]"
  4. Task with no routine references deletes normally

@abhigyan24-ops
Copy link
Copy Markdown
Author

@aryandas2911 please review and approve

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.

Bug: Deleting a task used in a saved routine leaves dangling references

1 participant