mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 18:41:08 +02:00
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:
parent
94d3277e2e
commit
ff823bff60
2 changed files with 6 additions and 1 deletions
|
|
@ -25,6 +25,7 @@ import {
|
|||
Heart,
|
||||
House,
|
||||
Key,
|
||||
Lightbulb,
|
||||
List,
|
||||
MagnifyingGlass,
|
||||
Microphone,
|
||||
|
|
@ -109,6 +110,7 @@ export const phosphorIcons: Record<string, any> = {
|
|||
scale: Scales,
|
||||
robot: Robot,
|
||||
key: Key,
|
||||
lightbulb: Lightbulb,
|
||||
shield: Shield,
|
||||
gift: Gift,
|
||||
'music-notes': MusicNotes,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue