Fix: Correct all database model names from camelCase to snake_case
- Fixed ai-analytics API: Created missing endpoint and corrected model names - Fixed ai-learning-status.ts: Updated to use ai_learning_data and trades models - Fixed batch-analysis route: Corrected ai_learning_data model references - Fixed analysis-details route: Updated automation_sessions and trades models - Fixed test scripts: Updated model names in check-learning-data.js and others - Disabled conflicting route files to prevent Next.js confusion All APIs now use correct snake_case model names matching Prisma schema: - ai_learning_data (not aILearningData) - automation_sessions (not automationSession) - trades (not trade) This resolves 'Unable to load REAL AI analytics' frontend errors.
This commit is contained in:
@@ -5,7 +5,7 @@ async function checkLearningData() {
|
||||
try {
|
||||
console.log('🔍 Checking AI learning data in database...');
|
||||
|
||||
const learningData = await prisma.aILearningData.findMany({
|
||||
const learningData = await prisma.ai_learning_data.findMany({
|
||||
orderBy: { createdAt: 'desc' },
|
||||
take: 5
|
||||
});
|
||||
@@ -47,7 +47,7 @@ async function checkLearningData() {
|
||||
}
|
||||
};
|
||||
|
||||
const sampleRecord = await prisma.aILearningData.create({
|
||||
const sampleRecord = await prisma.ai_learning_data.create({
|
||||
data: {
|
||||
userId: 'demo-user',
|
||||
analysis: sampleAnalysis.reasoning,
|
||||
|
||||
Reference in New Issue
Block a user