Skip to content

Commit 6ba7c1f

Browse files
Updated Dashboard Photo Sorting
1 parent d1d9cc9 commit 6ba7c1f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

server.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ app.get('/dashboard/', async (req, res) => {
180180
if (!user.isAdmin) {
181181
return res.status(403).json({ error: "Forbidden" });
182182
}
183-
const photos = await prisma.photo.findMany();
183+
const photos = await prisma.photo.findMany({
184+
orderBy: {
185+
createdAt: 'desc',
186+
},
187+
});
184188
res.render('dashboard.ejs', { user: user, photos: photos });
185189
});
186190

0 commit comments

Comments
 (0)