/// 멤버 API 서비스
library;

import '../models/member.dart';
import 'api_client.dart';

/// 멤버 목록 조회
Future<List<Member>> getMembers() async {
  final response = await dio.get('/members');
  final List<dynamic> data = response.data;
  return data.map((json) => Member.fromJson(json)).toList();
}

/// 활동 중인 멤버만 조회
Future<List<Member>> getActiveMembers() async {
  final members = await getMembers();
  return members.where((m) => !m.isFormer).toList();
}
