private final PostRepository postRepository;
private final RegistrationRepository registrationRepository;
@RequestMapping(method = POST)
@PreAuthorize("isAuthenticated()")
@ResponseStatus(CREATED)
<BUG>public EventEntity create(@Valid @RequestBody final EventEntity newEvent) {
return this.eventRepository.save(newEvent);</BUG>
}
@RequestMapping(value = "/{id:\\d+}/post/{postId:\\d+}", method = PUT)
@PreAuthorize("isAuthenticated()")

private final PostRepository postRepository;
private final RegistrationRepository registrationRepository;
@RequestMapping(method = POST)
@PreAuthorize("isAuthenticated()")
@ResponseStatus(CREATED)
public EventEntity create(@Valid @RequestBody final EventEntity newEvent) {
newEvent.setStatus(Optional.ofNullable(newEvent.getStatus()).orElse(Status.open));
return this.eventRepository.save(newEvent);
}
@RequestMapping(value = "/{id:\\d+}/post/{postId:\\d+}", method = PUT)
@PreAuthorize("isAuthenticated()")
