Skip to content

Commit

Permalink
#588 expose more api
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed Mar 29, 2019
1 parent 23065ce commit d644b62
Showing 1 changed file with 11 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.model.result.ValidationResult;
import lombok.AllArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -57,6 +58,15 @@ public class EventApiV2Controller {
}
}

@PostMapping("/event/{eventName}/promoCode/{promoCode}")
@ResponseBody
public ValidationResult savePromoCode(@PathVariable("eventName") String eventName,
@PathVariable("promoCode") String promoCode,
Model model,
HttpServletRequest request) {
return eventController.savePromoCode(eventName, promoCode, model, request);
}

@PostMapping(value = "/event/{eventName}/reserve-tickets")
public ResponseEntity<Map<String, ?>> reserveTicket(@PathVariable("eventName") String eventName,
@RequestBody ReservationForm reservation,
Expand All @@ -72,7 +82,7 @@ public class EventApiV2Controller {
} else {
String reservationIdentifier = redirectResult.substring(redirectResult.length()).replace("/book", "");
redirectAttributes.addAttribute("reservationIdentifier", reservationIdentifier);
return new ResponseEntity<>(redirectAttributes.asMap(), getCorsHeaders(), HttpStatus.OK);
return new ResponseEntity<>(redirectAttributes.asMap(), HttpStatus.OK);
}

}
Expand Down

0 comments on commit d644b62

Please sign in to comment.