feat: add admin application viewing

This commit is contained in:
Xyphyn committed 2023-08-07 14:19:46 -07:00
1 parent bfc4ef6ffe
commit 01b4102c73
11 files changed
+199 -11

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
import { profile } from '$lib/auth.js'
import { getClient } from '$lib/lemmy.js'
import { get } from 'svelte/store'
export async function load({ data, fetch, url }) {
if (!get(profile)) return
const { jwt } = get(profile)!
if (!jwt) return
const page = Number(url.searchParams.get('page')) || 1
const unreadOnly = (url.searchParams.get('unreadOnly') || 'true') == 'true'
const res = await getClient(undefined, fetch).listRegistrationApplications({
auth: jwt,
page: page,
limit: 40,
unread_only: unreadOnly,
})
return {
unreadOnly: unreadOnly,
page: page,
applications: res.registration_applications,
}
}