import { getRecentUrgeLogs } from "../../db/urge";

/** GET /api/urge?limit=20 */
export default defineEventHandler(async (event) => {
  const user = await requireUser(event);
  const query = getQuery(event);
  const limit = Math.min(100, parseInt((query.limit as string) || "20"));
  return getRecentUrgeLogs(user.id, limit);
});
