mirror of https://github.com/TZGyn/shortener
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
540 B
TypeScript
24 lines
540 B
TypeScript
import { env } from '$env/dynamic/public'
|
|
import { db } from '$lib/db'
|
|
import type { LayoutServerLoad } from './$types'
|
|
|
|
export const load = (async (event) => {
|
|
const user = event.locals.user
|
|
|
|
const projects = await db.query.project.findMany({
|
|
where: (project, { eq }) => eq(project.userId, user.id),
|
|
})
|
|
|
|
const breadcrumbs = [{ name: 'Home', path: '/dashboard' }]
|
|
|
|
const page_title = 'Home'
|
|
|
|
return {
|
|
shortener_url: env.PUBLIC_SHORTENER_URL,
|
|
user: user,
|
|
breadcrumbs,
|
|
page_title,
|
|
projects,
|
|
}
|
|
}) satisfies LayoutServerLoad
|