import { revalidatePath } from 'next/cache';
import { NextResponse } from 'next/server';

export async function GET() {
  try {
    revalidatePath('/', 'layout');
    revalidatePath('/', 'page');

    return NextResponse.json({ success: true });
  } catch (err) {
    return NextResponse.json(
      { error: 'Failed to drop cache', detail: err },
      { status: 500 },
    );
  }
}
