import { withAuth } from '../../../../lib/with-auth';

const API_BASE = process.env.NEXT_PUBLIC_API_URL_INTERNAL || 'http://recipe-api:8080';

export const GET = withAuth(async (_req, session) => {
  const res = await fetch(`${API_BASE}/api/products/deleted`, {
    headers: { Authorization: `Bearer ${session.accessToken}` },
  });
  const data = await res.json().catch(() => ([]));
  return Response.json(data, { status: res.status });
});
