From bca00e03a51056ec7dcea655e5a9741c286772fc Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Mon, 18 May 2026 03:45:17 +0200 Subject: [PATCH] feat(social/profile): approvedDomainsCount in foreign-profile response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Frontend Foreign-Profile-Page rendert 3 Stat-Cards (Posts/Followers/ Approved) — counter für approved DomainSubmissions hat im Endpoint gefehlt → undefined im UI. Co-Authored-By: Claude Opus 4.7 --- backend/server/api/social/profile/[userId].get.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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,