misc: Improve error handling

This commit is contained in:
Xyphyn committed 2023-07-03 12:33:04 -07:00
1 parent 98b5e4b5c1
commit a5460a03b4
23 files changed
+285 -202

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import { getClient } from '$lib/lemmy.js'
import type { ListingType, SortType } from 'lemmy-js-client'
export function load({ url }) {
const page = Number(url.searchParams.get('page') || 1) || 1
const sort: SortType = (url.searchParams.get('sort') as SortType) || 'Active'
const listingType: ListingType =
(url.searchParams.get('type') as ListingType) || 'Local'
return {
posts: getClient().getPosts({
limit: 40,
page: page,
sort: sort,
type_: listingType,
}),
streamed: {
site: getClient().getSite({}),
},
}
}