import { NextResponse } from 'next/server';
import { db } from '@/lib/db';
import { charts } from '@/lib/db/schema';
import { desc } from 'drizzle-orm';

export async function GET() {
  const allCharts = await db.select().from(charts).orderBy(desc(charts.created_at));
  return NextResponse.json(allCharts);
}
