From ff823bff60bfbf8172226cef286ff2065ab599b7 Mon Sep 17 00:00:00 2001 From: Till JS Date: Tue, 28 Apr 2026 15:16:11 +0200 Subject: [PATCH] fix(feedback): POST /api/v1/feedback liest appId aus X-App-Id-Header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Der Submit-Handler hat den Body 1:1 an feedbackService.createFeedback weitergereicht. Da CreateFeedbackInput appId nicht enthält (Client schickt es als X-App-Id-Header), schlug jeder INSERT mit "null value in column app_id violates not-null constraint" fehl. Außerdem: lightbulb-Icon im phosphor-icon-map nachgezogen, sonst zeigt der "Idee teilen"-Eintrag in der barMode-Variante des Usermenüs kein Icon (nur Label). Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/shared-ui/src/navigation/phosphor-icon-map.ts | 2 ++ services/mana-analytics/src/routes/feedback.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/shared-ui/src/navigation/phosphor-icon-map.ts b/packages/shared-ui/src/navigation/phosphor-icon-map.ts index b5d7613ff..0ace0f0c8 100644 --- a/packages/shared-ui/src/navigation/phosphor-icon-map.ts +++ b/packages/shared-ui/src/navigation/phosphor-icon-map.ts @@ -25,6 +25,7 @@ import { Heart, House, Key, + Lightbulb, List, MagnifyingGlass, Microphone, @@ -109,6 +110,7 @@ export const phosphorIcons: Record = { scale: Scales, robot: Robot, key: Key, + lightbulb: Lightbulb, shield: Shield, gift: Gift, 'music-notes': MusicNotes, diff --git a/services/mana-analytics/src/routes/feedback.ts b/services/mana-analytics/src/routes/feedback.ts index 1767bc832..bb17623ea 100644 --- a/services/mana-analytics/src/routes/feedback.ts +++ b/services/mana-analytics/src/routes/feedback.ts @@ -22,7 +22,10 @@ export function createFeedbackRoutes(feedbackService: FeedbackService) { r.post('/', async (c) => { const user = c.get('user'); const body = await c.req.json(); - const item = await feedbackService.createFeedback(user.userId, body); + // Body never carries appId — the client sends it as X-App-Id. + // Fall back to 'mana' so legacy callers don't 500 on a NOT NULL. + const appId = body.appId || c.req.header('x-app-id') || 'mana'; + const item = await feedbackService.createFeedback(user.userId, { ...body, appId }); return c.json(item, 201); });