From cf746729418e4baa4aba62ab49e26c42543c4b5a Mon Sep 17 00:00:00 2001 From: Tim <47184194+imgde@users.noreply.github.com> Date: Sat, 24 May 2025 14:07:05 +0200 Subject: [PATCH] Streamline parameter names --- .../de/htwsaar/webshop/controller/ImageController.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/00-backend/src/main/java/de/htwsaar/webshop/controller/ImageController.java b/00-backend/src/main/java/de/htwsaar/webshop/controller/ImageController.java index f91f827..a703361 100644 --- a/00-backend/src/main/java/de/htwsaar/webshop/controller/ImageController.java +++ b/00-backend/src/main/java/de/htwsaar/webshop/controller/ImageController.java @@ -15,8 +15,7 @@ import java.util.List; import static de.htwsaar.webshop.config.ControllerPathConfig.IMAGE_BASE; import static de.htwsaar.webshop.config.ControllerPathConfig.IMAGE_GET_ALL; -import static de.htwsaar.webshop.config.ParameterConfig.PARAM_ARTICLE_ID; -import static de.htwsaar.webshop.config.ParameterConfig.PARAM_IMAGE_ID; +import static de.htwsaar.webshop.config.ParameterConfig.*; import static de.htwsaar.webshop.util.LoggerUtil.logRequest; @RestController @@ -69,7 +68,7 @@ public class ImageController { @RequestMapping(path = IMAGE_BASE, method = RequestMethod.PUT, produces = "application/json") public ResponseEntity update(HttpServletRequest request, - @RequestParam(value = PARAM_IMAGE_ID) Long imageId, + @RequestParam(value = PARAM_ID) Long imageId, @RequestBody Image image) { logRequest(request); if (imageId == null || imageService.getImageById(imageId) == null) { @@ -81,7 +80,7 @@ public class ImageController { @RequestMapping(path = IMAGE_BASE, method = RequestMethod.DELETE, produces = "application/json") public ResponseEntity delete(HttpServletRequest request, - @RequestParam(value = PARAM_IMAGE_ID) Long imageId) { + @RequestParam(value = PARAM_ID) Long imageId) { logRequest(request); if (imageId == null) { log.warn("[{}] got invalid imageId", request.getRequestURI());