From ff038f31f951393976fc47efe557cdb0b5e0a8ad Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 2 Jan 2026 18:33:58 -0800 Subject: [PATCH] fix(pending-actions): fix API response handling and add Kong route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix pending_action_service.dart to access response.data instead of response - Add Kong route for /api/v1/admin/pending-actions to identity-service πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- backend/api-gateway/kong.yml | 4 ++++ .../lib/core/services/pending_action_service.dart | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/backend/api-gateway/kong.yml b/backend/api-gateway/kong.yml index 73422823..45a14208 100644 --- a/backend/api-gateway/kong.yml +++ b/backend/api-gateway/kong.yml @@ -48,6 +48,10 @@ services: paths: - /api/v1/identity/health strip_path: true + - name: identity-admin-pending-actions + paths: + - /api/v1/admin/pending-actions + strip_path: false # --------------------------------------------------------------------------- # Wallet Service - ι’±εŒ…ζœεŠ‘ diff --git a/frontend/mobile-app/lib/core/services/pending_action_service.dart b/frontend/mobile-app/lib/core/services/pending_action_service.dart index 956a5c71..96a4f445 100644 --- a/frontend/mobile-app/lib/core/services/pending_action_service.dart +++ b/frontend/mobile-app/lib/core/services/pending_action_service.dart @@ -155,19 +155,20 @@ class PendingActionService { try { final response = await _apiClient.get(ApiEndpoints.pendingActions); - debugPrint('[PendingActionService] 响应: $response'); + final data = response.data; + debugPrint('[PendingActionService] 响应: $data'); - if (response is Map) { - return PendingActionsResponse.fromJson(response); + if (data is Map) { + return PendingActionsResponse.fromJson(data); } // ε¦‚ζžœθΏ”ε›žηš„ζ˜―εˆ—θ‘¨ - if (response is List) { + if (data is List) { return PendingActionsResponse( - actions: response + actions: data .map((e) => PendingAction.fromJson(e as Map)) .toList(), - count: response.length, + count: data.length, ); }