leerob / leerob.io

✨ My portfolio built with Next.js, Tailwind, and Vercel.

Home Page:https://leerob.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Potential improvement for guestbook

dextermb opened this issue · comments

Hey,

I recently watched your YouTube video on prisma/planetscale.
It's great to see technologies that make it easier to integrate into any codebase.

const entries = await prisma.guestbook.findMany({
orderBy: {
updated_at: 'desc'
}
});
if (req.method === 'GET') {

I noticed that you're always loading all guestbook entries even if someone is attempting to create one.
Surely loading all entries should only be done within the GET method?

Cheers!

Great catch!