fix: dont use URL.canParse
This commit is contained in:
1 parent
12ab08f2d5
commit
f2b16d5669
3 files changed
+18
-6
No files matched your search
@@ -1,15 +1,18 @@
|
||||
import { profile } from '$lib/auth.js'
|
||||
import { getClient } from '$lib/lemmy.js'
|
||||
import { client } from '$lib/lemmy.js'
|
||||
import { redirect } from '@sveltejs/kit'
|
||||
import { get } from 'svelte/store'
|
||||
|
||||
export async function load({ params, fetch }) {
|
||||
const comment = await getClient(undefined, fetch).getComment({
|
||||
const comment = await client({
|
||||
instanceURL: params.instance,
|
||||
func: fetch,
|
||||
}).getComment({
|
||||
id: Number(params.id),
|
||||
})
|
||||
|
||||
redirect(
|
||||
302,
|
||||
`/post/${params.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}`
|
||||
);
|
||||
`/post/${params.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}`
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user