From 73d199cb4b5571267abf1c00e2e50e88a1af1e17 Mon Sep 17 00:00:00 2001 From: Joergen Date: Fri, 21 Jun 2024 13:53:54 +0200 Subject: [PATCH] Formatted the subscription is verified string to be valid html --- .../api/controllers/ClassificationController.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/klass-api/src/main/java/no/ssb/klass/api/controllers/ClassificationController.java b/klass-api/src/main/java/no/ssb/klass/api/controllers/ClassificationController.java index da81db3..f4dcf53 100644 --- a/klass-api/src/main/java/no/ssb/klass/api/controllers/ClassificationController.java +++ b/klass-api/src/main/java/no/ssb/klass/api/controllers/ClassificationController.java @@ -55,6 +55,7 @@ import org.springframework.hateoas.CollectionModel; import org.springframework.hateoas.server.mvc.WebMvcLinkBuilder; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.web.bind.WebDataBinder; @@ -535,14 +536,21 @@ public ResponseEntity removeTracking(@PathVariable Long classificationId return ResponseEntity.ok("Subscription is deleted."); } - @RequestMapping(value = "/classifications/verifyTracking/{email}/{token}", method = RequestMethod.GET) + @RequestMapping(value = "/classifications/verifyTracking/{email}/{token}", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE) public ResponseEntity verifyTracking(@PathVariable String email, @PathVariable String token) { try { subscriberService.verifyTracking(email, token); } catch (ClientException e) { throw new RestClientException(e.getMessage()); } - return ResponseEntity.ok("Subscription is verified."); + return ResponseEntity.ok(""" + +
Klass subscription
+ + Subscription is verified. + + + """); } private void addSearchLink(PagedModel response) {