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
This commit is contained in:
mindesbunister
2025-07-26 11:05:11 +02:00
parent f263cac55f
commit da184cae79

View File

@@ -6,12 +6,12 @@ const prisma = new PrismaClient()
export async function GET() { export async function GET() {
try { try {
// Get the latest automation session // Get the latest automation session
const session = await prisma.automationSession.findFirst({ const session = await prisma.automation_sessions.findFirst({
orderBy: { createdAt: 'desc' } orderBy: { createdAt: 'desc' }
}) })
// Get recent trades for calculations // Get recent trades for calculations
const recentTrades = session ? await prisma.trade.findMany({ const recentTrades = session ? await prisma.trades.findMany({
where: { where: {
userId: session.userId, userId: session.userId,
symbol: session.symbol symbol: session.symbol