From da184cae79cfddfcacc0edcad1965c1fc55348ab Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Sat, 26 Jul 2025 11:05:11 +0200 Subject: [PATCH] Fix status API database model names - Updated automationSession to automation_sessions - Updated trade to trades in status API - Resolves Overview page 'Something went wrong!' error - All APIs now use consistent snake_case model names --- app/api/status/route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/status/route.ts b/app/api/status/route.ts index 49927f0..c1af3f4 100644 --- a/app/api/status/route.ts +++ b/app/api/status/route.ts @@ -6,12 +6,12 @@ const prisma = new PrismaClient() export async function GET() { try { // Get the latest automation session - const session = await prisma.automationSession.findFirst({ + const session = await prisma.automation_sessions.findFirst({ orderBy: { createdAt: 'desc' } }) // Get recent trades for calculations - const recentTrades = session ? await prisma.trade.findMany({ + const recentTrades = session ? await prisma.trades.findMany({ where: { userId: session.userId, symbol: session.symbol