tdd 진행
This commit is contained in:
@@ -13,8 +13,14 @@ class MemberService with ChangeNotifier {
|
||||
bool _isLoading = false;
|
||||
String? _token;
|
||||
String? _clubId;
|
||||
final ApiService _apiService = ApiService();
|
||||
final ApiService _apiService;
|
||||
StreamSubscription? _eventSubscription;
|
||||
|
||||
// 기본 생성자
|
||||
MemberService() : _apiService = ApiService();
|
||||
|
||||
// 테스트용 생성자
|
||||
MemberService.forTest(this._apiService);
|
||||
|
||||
List<Member> get members => [..._members];
|
||||
bool get isLoading => _isLoading;
|
||||
@@ -60,9 +66,14 @@ class MemberService with ChangeNotifier {
|
||||
notifyListeners();
|
||||
|
||||
try {
|
||||
// 클럽 ID 가져오기
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final clubId = prefs.getString(ApiConfig.clubIdKey);
|
||||
// 클럽 ID 가져오기 - 메모리에 저장된 값을 우선 사용
|
||||
String? clubId = _clubId;
|
||||
|
||||
// 메모리에 없으면 SharedPreferences에서 가져오기
|
||||
if (clubId == null) {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
clubId = prefs.getString(ApiConfig.clubIdKey);
|
||||
}
|
||||
|
||||
if (clubId == null) {
|
||||
throw Exception('선택된 클럽이 없습니다');
|
||||
|
||||
Reference in New Issue
Block a user