From 9a823e8871d8670439602aec5a6cc3372047bb6d Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 10 Dec 2025 22:29:17 -0800 Subject: [PATCH] fix(referral): convert BigInt to string for JSON serialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../src/api/controllers/referral.controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/services/referral-service/src/api/controllers/referral.controller.ts b/backend/services/referral-service/src/api/controllers/referral.controller.ts index 13a03a5e..3949fd9d 100644 --- a/backend/services/referral-service/src/api/controllers/referral.controller.ts +++ b/backend/services/referral-service/src/api/controllers/referral.controller.ts @@ -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, }, ],