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

import { FetchTags } from '@/shared/api/tags';

export async function GET() {
  try {
    revalidateTag(FetchTags.TAYLOR);

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