TDD 작성

This commit is contained in:
2025-08-12 03:28:08 +09:00
parent 6033d59590
commit 107abc963f
156 changed files with 70906 additions and 642 deletions
+24
View File
@@ -211,4 +211,28 @@ class ClubService with ChangeNotifier {
throw Exception('클럽 정보 업데이트에 실패했습니다: $e');
}
}
// 클럽 정보 가져오기 (ID로)
Future<Club> fetchClub(String clubId) async {
if (_token == null) {
throw Exception('인증이 필요합니다');
}
try {
// 현재 클럽이 요청한 클럽과 동일한 경우 캐시된 데이터 반환
if (_currentClub != null && _currentClub!.id == clubId) {
return _currentClub!;
}
final data = await _apiService.post(
'${ApiConfig.clubs}',
data: {'clubId': clubId},
);
final club = Club.fromJson(data);
return club;
} catch (e) {
throw Exception('클럽 정보를 불러오는데 실패했습니다: $e');
}
}
}