Delete Tasks that do not belong to any series
All checks were successful
Java CI with Maven / build-and-push-frontend (push) Successful in 9s
Java CI with Maven / build-and-push-backend (push) Successful in 8s

This commit is contained in:
Sebastian Böckelmann 2024-03-16 10:09:52 +01:00
parent e58e6addb9
commit 3e3fba9b2d

View File

@ -90,7 +90,9 @@ public class TaskService {
public void deleteTask(Task task) { public void deleteTask(Task task) {
task.getTaskgroup().getTasks().remove(task); task.getTaskgroup().getTasks().remove(task);
taskgroupRepository.save(task.getTaskgroup()); taskgroupRepository.save(task.getTaskgroup());
taskSeriesService.deleteTaskSeriesItem(task); if(task.getTaskSerieItem() != null) {
taskSeriesService.deleteTaskSeriesItem(task);
}
taskRepository.delete(task); taskRepository.delete(task);
} }