[REF] refactor file pool model and imports
- Refactor SnFilePool using freezed + sealed for consistency with other Sn models - Add extension method listFromResponse for PoolService compatibility - Update PoolService and utils to use SnFilePool - Replace relative imports (../) with package imports for clarity and maintainability Signed-off-by: Texas0295 <kimura@texas0295.top>
This commit is contained in:
@@ -7,11 +7,11 @@ class PoolService {
|
||||
|
||||
PoolService(this._dio);
|
||||
|
||||
Future<List<FilePool>> fetchPools() async {
|
||||
Future<List<SnFilePool>> fetchPools() async {
|
||||
final response = await _dio.get('/drive/pools');
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return FilePool.listFromResponse(response.data);
|
||||
return SnFilePoolList.listFromResponse(response.data);
|
||||
} else {
|
||||
throw Exception('Failed to fetch pools: ${response.statusCode}');
|
||||
}
|
||||
|
Reference in New Issue
Block a user