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.
16 lines
364 B
TypeScript
16 lines
364 B
TypeScript
import { db } from '$lib/db'
|
|
import type { PageServerLoad } from './$types'
|
|
|
|
export const load = (async (event) => {
|
|
const user = event.locals.userObject
|
|
|
|
const shorteners = await db.query.shortener.findMany({
|
|
with: {
|
|
visitor: true,
|
|
},
|
|
where: (shortener, { eq }) => eq(shortener.userId, user.id),
|
|
})
|
|
|
|
return { shorteners }
|
|
}) satisfies PageServerLoad
|