Remove LoginAPI, because it does not belongs to JMAP server

This commit is contained in:
Dat PHAM HOANG
2021-09-16 16:21:51 +07:00
committed by Dat H. Pham
parent 5fd305d102
commit afe6095c7e
20 changed files with 22 additions and 345 deletions
@@ -1,20 +1,14 @@
import 'package:model/model.dart';
import 'package:tmail_ui_user/features/login/data/datasource/authentication_datasource.dart';
import 'package:tmail_ui_user/features/login/data/network/login_api.dart';
class AuthenticationDataSourceImpl extends AuthenticationDataSource {
final LoginAPI loginAPI;
AuthenticationDataSourceImpl(this.loginAPI);
AuthenticationDataSourceImpl();
@override
Future<UserProfile> authenticationUser(Uri baseUrl, UserName userName, Password password) {
return Future.sync(() async {
final userProfileResponse = await loginAPI.authenticationUser(baseUrl, AccountRequest(userName, password));
return userProfileResponse.toUserProfile();
}).catchError((error) {
throw error;
return Future.sync(() {
return UserProfile(userName.userName);
});
}
}