Files
photon-tbw/src/routes/profile/media/+page.ts
T
Xylight 5651ad475d feat: use state based auth instead of store based (#488)
* misc: switch to state for auth

* fix: class based auth not working
2025-02-08 13:49:09 -08:00

18 lines
427 B
TypeScript

import { profile } from '$lib/auth.svelte'
import { client } from '$lib/lemmy.js'
import { error } from '@sveltejs/kit'
import { get } from 'svelte/store'
export async function load({ fetch, url }) {
const { jwt } = profile.data
let page = Number(url.searchParams.get('page')) || 1
const res = await client({ func: fetch, auth: jwt }).listMedia({
limit: 20,
page: page,
})
return { images: res.images }
}