diff --git a/app/(Main)/[username]/[url]/page.tsx b/app/(Main)/[username]/[url]/page.tsx index d4ad8e9c..ade16b7f 100644 --- a/app/(Main)/[username]/[url]/page.tsx +++ b/app/(Main)/[username]/[url]/page.tsx @@ -22,9 +22,9 @@ export default async function PostView({ params }: { params: { username: string, _count: { select: { comments: true } } } }, - _count: { select: { posts: true, Followers: true, Following: true } }, + _count: { select: { posts: true, Followers: true, Followings: true } }, Followers: true, - Following: true + Followings: true } }); @@ -40,7 +40,7 @@ export default async function PostView({ params }: { params: { username: string, author: { include: { Followers: true, - Following: true + Followings: true } } } diff --git a/app/api/posts/[username]/[url]/route.ts b/app/api/posts/[username]/[url]/route.ts index 05f46988..7754cdf1 100644 --- a/app/api/posts/[username]/[url]/route.ts +++ b/app/api/posts/[username]/[url]/route.ts @@ -44,7 +44,7 @@ export async function GET( select: { posts: true, Followers: true, - Following: true, + Followings: true, }, }, posts: { diff --git a/app/api/posts/[username]/route.ts b/app/api/posts/[username]/route.ts index a8b7159d..3bddede5 100644 --- a/app/api/posts/[username]/route.ts +++ b/app/api/posts/[username]/route.ts @@ -40,7 +40,7 @@ export async function GET( select: { posts: true, Followers: true, - Following: true, + Followings: true, }, }, posts: { diff --git a/app/api/users/[username]/route.ts b/app/api/users/[username]/route.ts index edc936a6..50984b69 100644 --- a/app/api/users/[username]/route.ts +++ b/app/api/users/[username]/route.ts @@ -18,7 +18,7 @@ export async function GET(req: Request, { params }: { params: { username: string following: true } }, - Following: { + Followings: { include: { follower: true } diff --git a/app/api/users/top/route.ts b/app/api/users/top/route.ts index a95ebdc0..22f09f5e 100644 --- a/app/api/users/top/route.ts +++ b/app/api/users/top/route.ts @@ -32,7 +32,7 @@ export async function GET(request: NextRequest) { const topUsers = await postgres.user.findMany({ include: { Followers: true, - Following: true, + Followings: true, posts: true, }, take: 5, @@ -40,7 +40,7 @@ export async function GET(request: NextRequest) { id: { not: userid, }, - Following: { + Followings: { none: { followerId: userid, },