haixunMaster/app/api/automation/kill/route.ts

13 lines
406 B
TypeScript

import { NextResponse } from "next/server";
import { killAllAutomation } from "@/lib/automation/engine";
import { apiRouteErrorResponse } from "@/lib/auth/api";
export async function POST() {
try {
const count = await killAllAutomation();
return NextResponse.json({ success: true, disabledAccounts: count });
} catch (error) {
return apiRouteErrorResponse(error, "automation/kill");
}
}