misc: Improve error handling
This commit is contained in:
1 parent
98b5e4b5c1
commit
a5460a03b4
23 files changed
+285
-202
No files matched your search
@@ -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({}),
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user