|
|
|
@ -19,9 +19,7 @@ import java.io.IOException;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static org.springframework.util.StringUtils.isEmpty;
|
|
|
|
|
import static ru.ulstu.core.controller.Navigation.CONFERENCES_PAGE;
|
|
|
|
|
import static ru.ulstu.core.controller.Navigation.CONFERENCE_PAGE;
|
|
|
|
|
import static ru.ulstu.core.controller.Navigation.REDIRECT_TO;
|
|
|
|
|
import static ru.ulstu.core.controller.Navigation.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Controller()
|
|
|
|
@ -52,9 +50,6 @@ public class ConferenceController {
|
|
|
|
|
@PostMapping(value = "/conference", params = "save")
|
|
|
|
|
public String save(@Valid ConferenceDto conferenceDto, Errors errors) throws IOException {
|
|
|
|
|
filterEmptyDeadlines(conferenceDto);
|
|
|
|
|
if (conferenceDto.getDeadlines().isEmpty()) {
|
|
|
|
|
errors.rejectValue("deadlines", "errorCode", "Не может быть пустым");
|
|
|
|
|
}
|
|
|
|
|
if (errors.hasErrors())
|
|
|
|
|
return CONFERENCE_PAGE;
|
|
|
|
|
conferenceService.save(conferenceDto);
|
|
|
|
@ -69,6 +64,8 @@ public class ConferenceController {
|
|
|
|
|
return CONFERENCE_PAGE;
|
|
|
|
|
conferenceDto.getDeadlines().add(new Deadline());
|
|
|
|
|
return CONFERENCE_PAGE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void filterEmptyDeadlines(ConferenceDto conferenceDto) {
|
|
|
|
|