#62 fix remove deadline in other JPA operation
This commit is contained in:
parent
9711febefb
commit
34499abd60
@ -60,6 +60,7 @@ public class ConferenceService {
|
||||
public Integer update(ConferenceDto conferenceDto) throws IOException {
|
||||
Conference conference = conferenceRepository.findOne(conferenceDto.getId());
|
||||
conferenceRepository.save(copyFromDto(conference, conferenceDto));
|
||||
conferenceDto.getRemovedDeadlineIds().forEach(deadlineService::remove);
|
||||
return conference.getId();
|
||||
}
|
||||
|
||||
@ -74,8 +75,6 @@ public class ConferenceService {
|
||||
conference.setPing(0);
|
||||
conference.setBeginDate(conferenceDto.getBeginDate());
|
||||
conference.setEndDate(conferenceDto.getEndDate());
|
||||
conferenceDto.getRemovedDeadlineIds()
|
||||
.forEach(deadlineService::remove);
|
||||
conference.setDeadlines(deadlineService.saveOrCreate(conferenceDto.getDeadlines()));
|
||||
return conference;
|
||||
}
|
||||
|
@ -45,6 +45,5 @@ public class DeadlineService {
|
||||
@Transactional
|
||||
public void remove(Integer deadlineId) {
|
||||
deadlineRepository.delete(deadlineId);
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user