fix route

This commit is contained in:
Anton Romanov 2018-12-17 17:28:52 +04:00
parent 59e2c9b544
commit 05296bb26e

View File

@ -56,8 +56,11 @@ public class PaperController {
} }
@PostMapping(value = "/paper", params = "addDeadline") @PostMapping(value = "/paper", params = "addDeadline")
public String addDeadline(@Valid PaperDto paperDto) { public String addDeadline(@Valid PaperDto paperDto, Errors errors) {
filterEmptyDeadlines(paperDto); filterEmptyDeadlines(paperDto);
if (errors.hasErrors()) {
return "/papers/paper";
}
paperDto.getDeadlines().add(new DeadlineDto()); paperDto.getDeadlines().add(new DeadlineDto());
return "/papers/paper"; return "/papers/paper";
} }