TF-1487 Apply linter rule

This commit is contained in:
dab246
2023-02-24 12:12:54 +07:00
committed by Dat Vu
parent 117a8a8fc6
commit 2b71aba278
155 changed files with 798 additions and 1039 deletions
@@ -18,35 +18,27 @@ class ForwardingDataSourceImpl extends ForwardingDataSource {
Future<TMailForward> getForward(AccountId accountId) {
return Future.sync(() async {
return await _forwardingAPI.getForward(accountId);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
@override
Future<TMailForward> deleteRecipientInForwarding(AccountId accountId, DeleteRecipientInForwardingRequest deleteRequest) {
return Future.sync(() async {
return await _forwardingAPI.updateForward(accountId, deleteRequest.newTMailForward);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
@override
Future<TMailForward> addRecipientsInForwarding(AccountId accountId, AddRecipientInForwardingRequest addRequest) {
return Future.sync(() async {
return await _forwardingAPI.updateForward(accountId, addRequest.newTMailForward);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
@override
Future<TMailForward> editLocalCopyInForwarding(AccountId accountId, EditLocalCopyInForwardingRequest editRequest) {
return Future.sync(() async {
return await _forwardingAPI.updateForward(accountId, editRequest.newTMailForward);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
}
@@ -20,35 +20,27 @@ class IdentityDataSourceImpl extends IdentityDataSource {
{Properties? properties}) {
return Future.sync(() async {
return await _identityAPI.getAllIdentities(accountId, properties: properties);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
@override
Future<Identity> createNewIdentity(AccountId accountId, CreateNewIdentityRequest identityRequest) {
return Future.sync(() async {
return await _identityAPI.createNewIdentity(accountId, identityRequest);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
@override
Future<bool> deleteIdentity(AccountId accountId, IdentityId identityId) {
return Future.sync(() async {
return await _identityAPI.deleteIdentity(accountId, identityId);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
@override
Future<bool> editIdentity(AccountId accountId, EditIdentityRequest editIdentityRequest) {
return Future.sync(() async {
return await _identityAPI.editIdentity(accountId, editIdentityRequest);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
}
@@ -18,8 +18,6 @@ class ManageAccountDataSourceImpl extends ManageAccountDataSource {
Future<void> persistLanguage(Locale localeCurrent) {
return Future.sync(() async {
return await _languageCacheManager.persistLanguage(localeCurrent);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
}
@@ -22,9 +22,7 @@ class RuleFilterDataSourceImpl extends RuleFilterDataSource {
Future<List<TMailRule>> getAllTMailRule(AccountId accountId) {
return Future.sync(() async {
return await _ruleFilterAPI.getListTMailRule(accountId);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
@override
@@ -34,26 +32,20 @@ class RuleFilterDataSourceImpl extends RuleFilterDataSource {
return Future.sync(() async {
return await _ruleFilterAPI.updateListTMailRule(accountId, deleteEmailRuleRequest.currentEmailRules);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
@override
Future<List<TMailRule>> createNewEmailRuleFilter(AccountId accountId, CreateNewEmailRuleFilterRequest ruleFilterRequest) {
return Future.sync(() async {
return await _ruleFilterAPI.updateListTMailRule(accountId, ruleFilterRequest.newListTMailRules);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
@override
Future<List<TMailRule>> editEmailRuleFilter(AccountId accountId, EditEmailRuleFilterRequest ruleFilterRequest) {
return Future.sync(() async {
return await _ruleFilterAPI.updateListTMailRule(accountId, ruleFilterRequest.listTMailRulesUpdated);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
}
@@ -15,17 +15,13 @@ class VacationDataSourceImpl extends VacationDataSource {
Future<List<VacationResponse>> getAllVacationResponse(AccountId accountId) {
return Future.sync(() async {
return await _vacationAPI.getAllVacationResponse(accountId);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
@override
Future<List<VacationResponse>> updateVacation(AccountId accountId, VacationResponse vacationResponse) {
return Future.sync(() async {
return await _vacationAPI.updateVacation(accountId, vacationResponse);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}).catchError(_exceptionThrower.throwException);
}
}