/**
 * POST /api/jobs/<id>/reset_dedup — wipe job_seen for this job so the
 * next tick re-dispatches every item it finds.
 */

import { NextResponse } from 'next/server';
import { getJob, resetDedup } from '@/lib/jobs/store';

export async function POST(_req: Request, { params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  const job = getJob(id);
  if (!job) return NextResponse.json({ error: 'job not found' }, { status: 404 });
  const removed = resetDedup(id);
  return NextResponse.json({ ok: true, removed });
}
