Skip to content

Commit

Permalink
fix non-matching context paths
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Aug 1, 2024
1 parent a38e066 commit 2dc1cec
Show file tree
Hide file tree
Showing 3 changed files with 677 additions and 683 deletions.
10 changes: 5 additions & 5 deletions src/main/java/alfio/controller/api/admin/ResourceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public String handleSyntaxError(Exception ex) {
return cause.orElse("Something went wrong. Please check the syntax and retry");
}

@GetMapping("/overridable-template/")
@GetMapping("/overridable-template")
public List<TemplateResource> getOverridableTemplates() {
return Stream.of(TemplateResource.values()).filter(TemplateResource::overridable).collect(Collectors.toList());
}
Expand Down Expand Up @@ -221,7 +221,7 @@ private Event getEvent(Integer organizationId, Integer eventId, Principal princi

//------------------

@GetMapping("/resource/")
@GetMapping("/resource")
public List<UploadedResource> findAll(Principal principal) {
checkAccess(principal);
return uploadedResourceManager.findAll();
Expand Down Expand Up @@ -274,19 +274,19 @@ public ResponseEntity<UploadedResource> getMetadata(@PathVariable int organizati

//------------------

@PostMapping("/resource/")
@PostMapping("/resource")
public void uploadFile(@RequestBody UploadBase64FileModification upload, Principal principal) {
checkAccess(principal);
uploadedResourceManager.saveResource(upload).orElseThrow(IllegalArgumentException::new);
}

@PostMapping("/resource-organization/{organizationId}/")
@PostMapping("/resource-organization/{organizationId}")
public void uploadFile(@PathVariable int organizationId, @RequestBody UploadBase64FileModification upload, Principal principal) {
checkAccess(organizationId, principal);
uploadedResourceManager.saveResource(organizationId, upload).orElseThrow(IllegalArgumentException::new);
}

@PostMapping("/resource-event/{organizationId}/{eventId}/")
@PostMapping("/resource-event/{organizationId}/{eventId}")
public void uploadFile(@PathVariable int organizationId, @PathVariable int eventId, @RequestBody UploadBase64FileModification upload, Principal principal) {
checkAccess(organizationId, eventId, principal);
uploadedResourceManager.saveResource(organizationId, eventId, upload).orElseThrow(IllegalArgumentException::new);
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/alfio/util/TemplateResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@

public enum TemplateResource {

@Deprecated
GOOGLE_ANALYTICS("", "", TemplateManager.TemplateOutput.TEXT),

CONFIRMATION_EMAIL_FOR_ORGANIZER("/alfio/templates/confirmation-email-for-organizer", TemplateResource.MULTIPART_ALTERNATIVE_MIMETYPE, TemplateManager.TemplateOutput.HTML) {
@Override
public Map<String, Object> prepareSampleModel(Organization organization, PurchaseContext event, Optional<ImageData> imageData) {
Expand Down Expand Up @@ -478,6 +475,7 @@ public static Map<String, Object> prepareModelForConfirmationEmail(Organization
model.put("vatNr", vat.orElse(""));
model.put("tickets", tickets);
model.put("orderSummary", orderSummary);
model.put("publicId", reservationShortID);
model.put(BASE_URL, baseUrl);
model.put(RESERVATION_URL, reservationUrl);
model.put("locale", reservation.getUserLanguage());
Expand Down
Loading

0 comments on commit 2dc1cec

Please sign in to comment.