refactor: /api/trump nutzt json()-Helper + camelCase (Review Task 10)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -224,13 +224,13 @@ export function createServer(engine: LiveEngine, gridEngine: GridEngine, trumpEn
|
|||||||
return json(await getGrid(gridEngine));
|
return json(await getGrid(gridEngine));
|
||||||
case '/api/trump': {
|
case '/api/trump': {
|
||||||
const [state] = await db.select().from(botState).where(eq(botState.id, 3));
|
const [state] = await db.select().from(botState).where(eq(botState.id, 3));
|
||||||
const positions_trump = await db.select().from(trumpPositions);
|
const trumpPos = await db.select().from(trumpPositions);
|
||||||
const events = await db.select().from(trumpEvents).orderBy(desc(trumpEvents.eventTs)).limit(50);
|
const events = await db.select().from(trumpEvents).orderBy(desc(trumpEvents.eventTs)).limit(50);
|
||||||
return Response.json({
|
return json({
|
||||||
status: trumpEngine.status,
|
status: trumpEngine.status,
|
||||||
cash: state?.cash ?? null,
|
cash: state?.cash ?? null,
|
||||||
startCapital: state?.startCapital ?? null,
|
startCapital: state?.startCapital ?? null,
|
||||||
positions: positions_trump,
|
positions: trumpPos,
|
||||||
events,
|
events,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user