Parse ?lang query param in cookie banner config API

Pass the lang parameter from the request URL to the service
so the config response returns localized texts and category
names for the requested language.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-23 10:05:03 +04:00
parent de47fb0702
commit 3a3335f28a

View File

@@ -65,7 +65,9 @@ func (h *Handler) handleGetConfig(w http.ResponseWriter, r *http.Request) {
return
}
config, err := h.cookieBannerSvc.GetActiveBannerConfig(r.Context(), bannerID)
lang := r.URL.Query().Get("lang")
config, err := h.cookieBannerSvc.GetActiveBannerConfig(r.Context(), bannerID, lang)
if err != nil {
if errors.Is(err, cookiebanner.ErrBannerNotFound) {
jsonutil.RenderNotFound(w, fmt.Errorf("banner not found"))