Skip to content

Commit

Permalink
fix: #346
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
Innei committed Apr 24, 2024
1 parent 742dd5e commit ab359f5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/app/(app)/posts/(post-detail)/[category]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { redirect } from 'next/navigation'

import { apiClient } from '~/lib/request'
import { definePrerenderPage } from '~/lib/request.server'

export default definePrerenderPage<{
category: string
}>()({
fetcher({ category }) {
return apiClient.post.getFullUrl(category)
},
Component({ data }) {
redirect(`/posts${data.path}`)

return (
<div>
正在重定向到 <pre>{`/posts${data.path}`}</pre>
</div>
)
},
})

0 comments on commit ab359f5

Please sign in to comment.