2024-09-01 19:22:00 +00:00
|
|
|
import { notSignedInMessage } from '$lib/flashMessages'
|
|
|
|
|
import { redirect } from 'sveltekit-flash-message/server'
|
|
|
|
|
import type { PageServerLoad } from './$types'
|
2024-03-15 19:05:47 +00:00
|
|
|
|
|
|
|
|
export const load: PageServerLoad = async (event) => {
|
2024-09-01 19:22:00 +00:00
|
|
|
const { locals } = event
|
|
|
|
|
|
|
|
|
|
const authedUser = await locals.getAuthedUser()
|
|
|
|
|
if (!authedUser) {
|
|
|
|
|
throw redirect(302, '/login', notSignedInMessage, event)
|
2024-03-15 19:05:47 +00:00
|
|
|
}
|
|
|
|
|
|
2024-09-01 19:22:00 +00:00
|
|
|
// const users = await db.query.users.findMany({
|
|
|
|
|
// limit: 10,
|
|
|
|
|
// offset: 0,
|
|
|
|
|
// });
|
2024-03-15 19:05:47 +00:00
|
|
|
|
|
|
|
|
return {
|
2024-09-01 19:22:00 +00:00
|
|
|
// users,
|
|
|
|
|
}
|
|
|
|
|
}
|