feat(social/profile): approvedDomainsCount in foreign-profile response
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 <noreply@anthropic.com>
This commit is contained in:
parent
c6e2116084
commit
bca00e03a5
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user