feat: implement complete automation system with real trading connection
This commit is contained in:
21
app/api/automation/stop/route.js
Normal file
21
app/api/automation/stop/route.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { automationService } from '@/lib/automation-service-simple'
|
||||
|
||||
export async function POST() {
|
||||
try {
|
||||
const success = await automationService.stopAutomation()
|
||||
|
||||
if (success) {
|
||||
return NextResponse.json({ success: true, message: 'Automation stopped successfully' })
|
||||
} else {
|
||||
return NextResponse.json({ success: false, error: 'Failed to stop automation' }, { status: 500 })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Stop automation error:', error)
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
error: 'Internal server error',
|
||||
message: error.message
|
||||
}, { status: 500 })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user