fix(pending-actions): fix API response handling and add Kong route

- 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 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-02 18:33:58 -08:00
parent 28e0396a65
commit ff038f31f9
2 changed files with 11 additions and 6 deletions

View File

@ -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 - 钱包服务

View File

@ -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<String, dynamic>) {
return PendingActionsResponse.fromJson(response);
if (data is Map<String, dynamic>) {
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<String, dynamic>))
.toList(),
count: response.length,
count: data.length,
);
}