diff --git a/backend/server/api/social/profile/[userId].get.ts b/backend/server/api/social/profile/[userId].get.ts index e1602a8..9e988a1 100644 --- a/backend/server/api/social/profile/[userId].get.ts +++ b/backend/server/api/social/profile/[userId].get.ts @@ -17,7 +17,7 @@ export default defineEventHandler(async (event) => { currentUserId = u.id; } catch {} - const [profile, score, followRelation, recentPosts, metaMap, postsCount, followingCount] = + const [profile, score, followRelation, recentPosts, metaMap, postsCount, followingCount, approvedDomainsCount] = await Promise.all([ getProfile(targetUserId), getUserScore(targetUserId), @@ -44,6 +44,9 @@ export default defineEventHandler(async (event) => { usePrisma().userFollow.count({ where: { followerId: targetUserId }, }), + usePrisma().domainSubmission.count({ + where: { userId: targetUserId, status: "approved" }, + }), ]); if (!profile) @@ -60,6 +63,7 @@ export default defineEventHandler(async (event) => { followersCount: profile.followersCount ?? 0, followingCount, postsCount, + approvedDomainsCount, tier: score?.tier ?? "beginner", totalPoints: score?.totalPoints ?? 0, isFollowing: !!followRelation,