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:
parent
28e0396a65
commit
ff038f31f9
|
|
@ -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 - 钱包服务
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue