feat: Implement agent network management and refactor app navigation with a new AppShell component.
This commit is contained in:
@@ -195,6 +195,33 @@ class AgentsRepository {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get received connection requests: GET /connection-requests/received?status=...
|
||||
Future<List<Map<String, dynamic>>> getReceivedRequests(String status) async {
|
||||
try {
|
||||
final response = await _dio.get(
|
||||
'${ApiConstants.connectionRequests}/received',
|
||||
queryParameters: {'status': status},
|
||||
);
|
||||
final data = response.data['data'] as List<dynamic>? ?? [];
|
||||
return data.cast<Map<String, dynamic>>();
|
||||
} on DioException catch (_) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/// Respond to connection request: PATCH /connection-requests/{id}/respond
|
||||
Future<bool> respondToRequest(String requestId, String status) async {
|
||||
try {
|
||||
await _dio.patch(
|
||||
'${ApiConstants.connectionRequests}/$requestId/respond',
|
||||
data: {'status': status},
|
||||
);
|
||||
return true;
|
||||
} on DioException catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// Get agent types: GET /agent-types
|
||||
/// Response: { success, data: [...] }
|
||||
Future<List<AgentType>> getAgentTypes() async {
|
||||
|
||||
Reference in New Issue
Block a user