feat: 个人中心展示决策次数徽章「已拯救 X 次选择困难症」

This commit is contained in:
2026-02-26 14:54:46 +08:00
parent 7aa6c7f792
commit 05e42ffe22
2 changed files with 11 additions and 1 deletions
+3
View File
@@ -13,6 +13,8 @@ export async function GET(req: NextRequest) {
return NextResponse.json(null);
}
const decisionCount = await prisma.decision.count({ where: { userId } });
return NextResponse.json({
id: user.id,
username: user.username,
@@ -20,6 +22,7 @@ export async function GET(req: NextRequest) {
email: user.email,
preferences: JSON.parse(user.preferences),
createdAt: user.createdAt.toISOString(),
decisionCount,
});
}