import type { Context } from "hono";
import { prisma } from "../../../lib/prisma";
import { cache } from "../../../lib/cache";

export async function getCurrentQuotes(c: Context) {
  const cached = cache.get("quotes:current");
  if (cached) return c.json(cached);

  const quotes = await prisma.quote.findMany();
  cache.set("quotes:current", quotes);
  return c.json(quotes);
}
