Skip to content

Commit

Permalink
[#17] Integrate loading profile picture
Browse files Browse the repository at this point in the history
  • Loading branch information
nmint8m committed Feb 17, 2023
1 parent 5d904a0 commit cf8cb04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/api/api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ abstract class ApiService {
Future<List<UserResponse>> getUsers();

@GET('/api/v1/me')
Future<MeResponse> me();
Future<MeResponse> getMe();
}
6 changes: 3 additions & 3 deletions lib/api/repository/user_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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();
Future<MeResponse> getMe();
}

@Singleton(as: UserRepository)
Expand All @@ -14,9 +14,9 @@ class UserRepositoryImpl extends UserRepository {
UserRepositoryImpl(this._apiService);

@override
Future<MeResponse> me() async {
Future<MeResponse> getMe() async {
try {
return await _apiService.me();
return await _apiService.getMe();
} catch (exception) {
throw NetworkExceptions.fromDioException(exception);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/usecases/user/get_profile_use_case.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ProfileUseCase extends NoParamsUseCase<Profile> {
@override
Future<Result<Profile>> call() async {
try {
final result = await _repository.me();
final result = await _repository.getMe();
return Success(Profile(
id: result.id,
email: result.email,
Expand Down

0 comments on commit cf8cb04

Please sign in to comment.