diff --git a/backend/.idea/workspace.xml b/backend/.idea/workspace.xml
index cce1f6b..3f81d0a 100644
--- a/backend/.idea/workspace.xml
+++ b/backend/.idea/workspace.xml
@@ -4,18 +4,9 @@
-
-
-
+
-
-
-
-
-
-
-
-
+
@@ -559,14 +550,21 @@
1699786723938
-
+
+
+ 1699803821051
+
+
+
+ 1699803821051
+
+
-
@@ -591,7 +589,8 @@
-
+
+
@@ -611,6 +610,11 @@
93
+
+ file://$PROJECT_DIR$/src/main/java/core/services/TaskService.java
+ 92
+
+
diff --git a/backend/src/main/java/core/services/TaskService.java b/backend/src/main/java/core/services/TaskService.java
index 1df8378..d80c784 100644
--- a/backend/src/main/java/core/services/TaskService.java
+++ b/backend/src/main/java/core/services/TaskService.java
@@ -77,11 +77,6 @@ public class TaskService {
return new ServiceResult<>(ServiceExitCode.INVALID_PARAMETER);
}
- //Check for invalid date (deadline before start
- if(taskFieldInfo.getStartDate() != null && taskFieldInfo.getDeadline() != null &&
- taskFieldInfo.getDeadline().isBefore(taskFieldInfo.getStartDate())) {
- return new ServiceResult<>(ServiceExitCode.INVALID_PARAMETER);
- }
task.setEta(taskFieldInfo.getEta());
task.setStartDate(taskFieldInfo.getStartDate());
task.setDeadline(taskFieldInfo.getDeadline());
@@ -91,7 +86,12 @@ public class TaskService {
public void deleteTask(Task task) {
//taskScheduleService.deleteScheduleByTask(task);
- taskRepository.deleteByTaskID(task.getTaskID());
+ System.err.println(task.getTaskID());
+ task.getTaskgroup().getTasks().remove(task);
+ taskgroupRepository.save(task.getTaskgroup());
+ task.setTaskgroup(null);
+ taskRepository.save(task);
+ taskRepository.delete(task);
}
public void clearTasks(Taskgroup taskgroup) {