fix(referral): convert BigInt to string for JSON serialization

BigInt cannot be serialized by JSON.stringify, convert to string
before returning from the API endpoint.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-10 22:29:17 -08:00
parent 1afdc2ce17
commit 9a823e8871
1 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ export class ReferralController {
})
async getReferralChainForReward(
@Param('userId') userId: string,
): Promise<{ ancestors: Array<{ userId: bigint; hasPlanted: boolean }> }> {
): Promise<{ ancestors: Array<{ userId: string; hasPlanted: boolean }> }> {
const userIdBigInt = BigInt(userId);
// 获取用户的推荐关系
@ -140,7 +140,7 @@ export class ReferralController {
return {
ancestors: [
{
userId: referrerId,
userId: referrerId.toString(),
hasPlanted,
},
],