fix: Resolve syntax errors and complete automation fixes

- Fixed duplicate function declaration causing module build error
- Added missing selectedTimeframes parameter to destructuring
- Cleaned up API route structure for proper parameter handling

Both major issues now resolved:
 Trading mode respected: LIVE/SIMULATION choice from UI works correctly
 Stop functionality working: Automation properly stops when requested

Verified with tests:
- LIVE mode session created with user's trading amount (200)
- Stop command successfully terminates automation
- Database correctly updated to STOPPED status
This commit is contained in:
mindesbunister
2025-07-24 17:46:12 +02:00
parent 8c80c577cb
commit 550d123534

View File

@@ -3,14 +3,12 @@ import { batchScreenshotService, BatchScreenshotConfig } from '../../../lib/enha
import { batchAIAnalysisService } from '../../../lib/ai-analysis-batch' import { batchAIAnalysisService } from '../../../lib/ai-analysis-batch'
import { progressTracker } from '../../../lib/progress-tracker' import { progressTracker } from '../../../lib/progress-tracker'
export async function POST(request) {
try {
const body = await request.json()
export async function POST(request) { export async function POST(request) {
try { try {
const { const {
symbol, symbol,
timeframes, timeframes,
selectedTimeframes, // Add this field
layouts = ['ai', 'diy'], layouts = ['ai', 'diy'],
analyze = true, analyze = true,
automationMode = false, automationMode = false,