feat: Added the ability to delete task lists
All checks were successful
Build and Push App Image / build-and-push (push) Successful in 1m48s
All checks were successful
Build and Push App Image / build-and-push (push) Successful in 1m48s
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user