feat: Added the ability to delete task lists
All checks were successful
Build and Push App Image / build-and-push (push) Successful in 1m48s

This commit is contained in:
domrichardson
2026-03-30 10:14:07 +01:00
parent b9ca845b9c
commit b09137eca5
5 changed files with 62 additions and 6 deletions

View File

@@ -812,13 +812,9 @@ func (s *TaskService) DeleteTaskList(ctx context.Context, spaceID, taskListID, u
return errors.New("task list not found")
}
tasks, err := s.taskRepo.ListTasks(ctx, spaceID, map[string]any{"task_list_id": taskListID})
if err != nil {
if err := s.taskRepo.DeleteTasksByTaskListID(ctx, taskListID); err != nil {
return err
}
if len(tasks) > 0 {
return errors.New("cannot delete task list with tasks")
}
return s.taskListRepo.DeleteTaskList(ctx, taskListID)
}