import { NextRequest, NextResponse } from 'next/server'; import './jobs'; import { hooks } from './Hooks'; /* export async function GET() { return NextResponse.json({ schedules: schedules.toJSON() }, { status: 200 }); } export async function POST(request: Request) { } */ export async function hookHandler(request: NextRequest, res: NextResponse) { if (request.method === 'POST') { const body = await request.json(); const hookId = body.hookId; hooks.run(hookId); return NextResponse.json({ message: 'Callback triggered' }, { status: 200 }); } else { return NextResponse.json({ hooks: hooks.toJSON() }, { status: 200 }); } }