import 'dart:convert';
import 'package:maxdash/api/api_client.dart';

class ApiService {
  final ApiClient _apiClient = ApiClient.instance;

  Future<dynamic> getProjectSummaries() async {
    try {
      final response = await _apiClient.get('project/list');

      if (response.statusCode == 200) {
        // print('Response body: ${response.body}'); // Parsed JSON
        return jsonDecode(response.body);
        
      } else {
        throw Exception('Failed to load project summaries: ${response.statusCode}');
      }
    } catch (e) {
      throw Exception('Error in getProjectSummaries: $e');
    }
  }
}
