From 8a4e19de66a59795f03b93d01dd414250cc982c8 Mon Sep 17 00:00:00 2001 From: Pol Pinol Castuera Date: Tue, 27 May 2025 18:49:34 +0200 Subject: [PATCH] Add userId in header for UI --- src/main/java/io/autoinvestor/ui/GetAlertsController.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/autoinvestor/ui/GetAlertsController.java b/src/main/java/io/autoinvestor/ui/GetAlertsController.java index 10410ad..5559a65 100644 --- a/src/main/java/io/autoinvestor/ui/GetAlertsController.java +++ b/src/main/java/io/autoinvestor/ui/GetAlertsController.java @@ -4,10 +4,7 @@ import io.autoinvestor.application.GetAlertsQueryHandler; import io.autoinvestor.application.GetAlertsQueryResponse; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -22,8 +19,7 @@ public GetAlertsController(GetAlertsQueryHandler handler) { } @GetMapping - public ResponseEntity> getAlerts( - @RequestParam String userId) { + public ResponseEntity> getAlerts(@RequestHeader(value = "X-User-Id") String userId) { List queryResponse = this.handler.handle( new GetDecisionsQuery(userId)