|
|
|
@ -11,6 +11,7 @@ import ru.ulstu.tags.model.Tag;
|
|
|
|
|
import ru.ulstu.tags.model.TagDto;
|
|
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
import ru.ulstu.students.service.TaskService;
|
|
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -55,7 +56,7 @@ public class TaskController {
|
|
|
|
|
if (taskDto.getDeadlines().isEmpty()) {
|
|
|
|
|
errors.rejectValue("deadlines", "errorCode", "Не может быть пустым");
|
|
|
|
|
}
|
|
|
|
|
if(errors.hasErrors())
|
|
|
|
|
if (errors.hasErrors())
|
|
|
|
|
return TASK_PAGE;
|
|
|
|
|
taskService.save(taskDto);
|
|
|
|
|
return String.format(REDIRECT_TO, TASKS_PAGE);
|
|
|
|
@ -64,7 +65,7 @@ public class TaskController {
|
|
|
|
|
@PostMapping(value = "/task", params = "addDeadline")
|
|
|
|
|
public String addDeadline(@Valid TaskDto taskDto, Errors errors) {
|
|
|
|
|
filterEmptyDeadlines(taskDto);
|
|
|
|
|
if(errors.hasErrors())
|
|
|
|
|
if (errors.hasErrors())
|
|
|
|
|
return TASK_PAGE;
|
|
|
|
|
taskDto.getDeadlines().add(new Deadline());
|
|
|
|
|
return TASK_PAGE;
|
|
|
|
|