feat: add media list

This commit is contained in:
Xylight committed 2024-07-20 11:49:05 -07:00
1 parent 0a6310380f
commit 29bfa9104a
7 files changed
+200 -6

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { profile } from '$lib/auth.js'
import { client } from '$lib/lemmy.js'
import { get } from 'svelte/store'
export async function load({ fetch, url }) {
const { jwt } = get(profile)
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 }
}