fix: await searchParams and params for Next.js 15 async API, compute totalPages in all-users page
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m41s
test / unit (pull_request) Successful in 16m33s
test / integration (pull_request) Failing after 17m3s
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m41s
test / unit (pull_request) Successful in 16m33s
test / integration (pull_request) Failing after 17m3s
This commit is contained in:
@@ -4,11 +4,11 @@ import { getFollowersList } from "@/lib/api";
|
||||
import { UserListCard } from "@/components/user-list-card";
|
||||
|
||||
interface FollowersPageProps {
|
||||
params: { username: string };
|
||||
params: Promise<{ username: string }>;
|
||||
}
|
||||
|
||||
export default async function FollowersPage({ params }: FollowersPageProps) {
|
||||
const { username } = params;
|
||||
const { username } = await params;
|
||||
const token = (await cookies()).get("auth_token")?.value ?? null;
|
||||
|
||||
const followersData = await getFollowersList(username, token).catch(
|
||||
|
||||
@@ -4,11 +4,11 @@ import { getFollowingList } from "@/lib/api";
|
||||
import { UserListCard } from "@/components/user-list-card";
|
||||
|
||||
interface FollowingPageProps {
|
||||
params: { username: string };
|
||||
params: Promise<{ username: string }>;
|
||||
}
|
||||
|
||||
export default async function FollowingPage({ params }: FollowingPageProps) {
|
||||
const { username } = params;
|
||||
const { username } = await params;
|
||||
const token = (await cookies()).get("auth_token")?.value ?? null;
|
||||
|
||||
const followingData = await getFollowingList(username, token).catch(
|
||||
|
||||
@@ -21,11 +21,11 @@ import { Button } from "@/components/ui/button";
|
||||
import Link from "next/link";
|
||||
|
||||
interface ProfilePageProps {
|
||||
params: { username: string };
|
||||
params: Promise<{ username: string }>;
|
||||
}
|
||||
|
||||
export default async function ProfilePage({ params }: ProfilePageProps) {
|
||||
const { username } = params;
|
||||
const { username } = await params;
|
||||
const token = (await cookies()).get("auth_token")?.value ?? null;
|
||||
|
||||
const userProfilePromise = getUserProfile(username, token);
|
||||
|
||||
Reference in New Issue
Block a user