|
|
@ -5,6 +5,7 @@ import org.springframework.ui.ModelMap;
|
|
|
|
import org.springframework.validation.Errors;
|
|
|
|
import org.springframework.validation.Errors;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
@ -78,6 +79,12 @@ public class ProjectController {
|
|
|
|
return "/projects/project";
|
|
|
|
return "/projects/project";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/delete/{project-id}")
|
|
|
|
|
|
|
|
public String delete(@PathVariable("project-id") Integer projectId) throws IOException {
|
|
|
|
|
|
|
|
projectService.delete(projectId);
|
|
|
|
|
|
|
|
return String.format("redirect:%s", "/projects/projects");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void filterEmptyDeadlines(ProjectDto projectDto) {
|
|
|
|
private void filterEmptyDeadlines(ProjectDto projectDto) {
|
|
|
|
projectDto.setDeadlines(projectDto.getDeadlines().stream()
|
|
|
|
projectDto.setDeadlines(projectDto.getDeadlines().stream()
|
|
|
|
.filter(dto -> dto.getDate() != null || !isEmpty(dto.getDescription()))
|
|
|
|
.filter(dto -> dto.getDate() != null || !isEmpty(dto.getDescription()))
|
|
|
|