Add presentation layer for get Session
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import 'dart:core';
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/credential_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/state/delete_credential_state.dart';
|
||||
|
||||
class DeleteCredentialInteractor {
|
||||
final CredentialRepository credentialRepository;
|
||||
|
||||
DeleteCredentialInteractor(this.credentialRepository);
|
||||
|
||||
Future<Either<Failure, Success>> execute() async {
|
||||
try {
|
||||
await Future.wait([
|
||||
credentialRepository.removeBaseUrl(),
|
||||
credentialRepository.removeUserName(),
|
||||
credentialRepository.removePassword()
|
||||
]);
|
||||
return Right(DeleteCredentialSuccess());
|
||||
} catch (exception) {
|
||||
return Left(DeleteCredentialFailure(exception));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user