feat: make comments available in ssr
This commit is contained in:
1 parent
b3ad7eeae9
commit
00840227d2
6 files changed
+62
-71
No files matched your search
@@ -2,5 +2,6 @@ import { getInstance } from '$lib/lemmy.js'
|
||||
import { redirect } from '@sveltejs/kit'
|
||||
|
||||
export function load({ params }) {
|
||||
// If you somehow got to /comment/instance, it likely means you passed in an ID, not an instance.
|
||||
throw redirect(300, `/comment/${getInstance()}/${params.instance}`)
|
||||
}
|
||||
@@ -10,6 +10,6 @@ export async function load({ params, fetch }) {
|
||||
|
||||
throw redirect(
|
||||
300,
|
||||
`/post/${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