Skip to content

Commit

Permalink
[#42] Create the user repository
Browse files Browse the repository at this point in the history
  • Loading branch information
nmint8m committed Feb 15, 2023
1 parent 5c9f957 commit 3d8a734
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 0 additions & 22 deletions lib/api/repository/credential_repository.dart

This file was deleted.

22 changes: 22 additions & 0 deletions lib/api/repository/user_repository.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:kayla_flutter_ic/api/api_service.dart';
import 'package:kayla_flutter_ic/api/exception/network_exceptions.dart';
import 'package:kayla_flutter_ic/api/response/me_response.dart';

abstract class UserRepository {
Future<MeResponse> me();
}

class UserRepositoryImpl extends UserRepository {
final ApiService _apiService;

UserRepositoryImpl(this._apiService);

@override
Future<MeResponse> me() async {
try {
return await _apiService.me();
} catch (exception) {
throw NetworkExceptions.fromDioException(exception);
}
}
}

0 comments on commit 3d8a734

Please sign in to comment.