import { Router } from 'express';
import { prisma } from '../prisma.js';
const router = Router();

router.get('/', async (_req, res) => {
  const listings = await prisma.listing.findMany({ orderBy: { createdAt: 'desc' }, take: 10 });
  res.json(listings);
});

export default router;