fix(feedback): POST /api/v1/feedback liest appId aus X-App-Id-Header

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) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-28 15:16:11 +02:00
parent 94d3277e2e
commit ff823bff60
2 changed files with 6 additions and 1 deletions

View file

@ -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);
});