Skip to content

Commit

Permalink
#588 workaround when we have a single event
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed Mar 29, 2019
1 parent d644b62 commit cf946e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import alfio.controller.EventController;
import alfio.controller.form.ReservationForm;
import alfio.manager.EventManager;
import alfio.model.result.ValidationResult;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpHeaders;
Expand All @@ -40,11 +41,15 @@
public class EventApiV2Controller {

private final EventController eventController;
private final EventManager eventManager;


@GetMapping("events")
public ResponseEntity<Map<String, ?>> listEvents(Model model, Locale locale, HttpServletRequest request) {
eventController.listEvents(model, locale);
if(!"/event/event-list".equals(eventController.listEvents(model, locale))) {
model.addAttribute("singleEvent", true);
model.addAttribute("eventShortName", eventManager.getPublishedEvents().get(0).getShortName());
}
return new ResponseEntity<>(model.asMap(), getCorsHeaders(), HttpStatus.OK);
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/alfio/model/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public enum EventType {
private final boolean vatIncluded;
private final BigDecimal vat;
private final List<PaymentProxy> allowedPaymentProxies;

@JsonIgnore
private final String privateKey;
private final ZoneId timeZone;
private final int locales;
Expand Down

0 comments on commit cf946e3

Please sign in to comment.