thomaswilson-sveltekit/src/routes/photo-posts/+page.server.ts

10 lines
262 B
TypeScript

import type { PageServerLoad } from './$types.js';
export const load: PageServerLoad = async ({ locals }) => {
const allPosts = await locals.prisma.photoPost.findMany({
orderBy: { createdAt: 'asc' },
});
return {
allPosts,
};
};