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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user