Closed kasugaijin closed 8 months ago
I see the problem.
This line in the update action
@task.next_due_date_in_days = nil unless task_params.dig(:next_due_date_in_days)
was added to handle the case that someone wanted to edit a recurring action to remove the due date. But this isn't quite right because checking complete doesn't send the next_due_in_days field.
If we switch to:
@task.next_due_date_in_days = nil unless task_params.dig(:next_due_date_in_days) || task_params.dig(:completed)
then I think that will solve the problem.
I can make the change and add tests to cover this if you want.
Ah good catch @MooseCowBear ! Assigned.
To reproduce: Go to Pet > Tasks and create a new task that is recurring, has due date in future, and next due at in days. Save it. Then try to mark it complete.
What should happen: the recurring task is marked complete and a new identical, recurring task is created with a new due date and is added to the list of tasks.
What happens: Task does not save due to failed request.