fix: remove conflicting profile route
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s
This commit is contained in:
parent
97417ee03c
commit
d20cc75085
1 changed files with 0 additions and 41 deletions
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
import { getApiUrl } from "@/lib/api-config"
|
||||
import { ProfilePoster } from "@/components/profile/profile-poster"
|
||||
import { notFound } from "next/navigation"
|
||||
|
||||
interface ProfilePageProps {
|
||||
params: Promise<{
|
||||
username: string
|
||||
}>
|
||||
}
|
||||
|
||||
async function getProfile(username: string) {
|
||||
try {
|
||||
const res = await fetch(`${getApiUrl()}/users/profile/${username}`, {
|
||||
next: { revalidate: 60 } // Cache for 1 minute
|
||||
})
|
||||
|
||||
if (res.status === 404) return null
|
||||
if (!res.ok) throw new Error("Failed to fetch profile")
|
||||
|
||||
return res.json()
|
||||
} catch (error) {
|
||||
console.error("Profile fetch error:", error)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export default async function ProfilePage({ params }: ProfilePageProps) {
|
||||
const { username } = await params
|
||||
const profile = await getProfile(username)
|
||||
|
||||
if (!profile) {
|
||||
notFound()
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="container py-8">
|
||||
<ProfilePoster profile={profile} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue