TF-1865: Create func update sending email in data layer

(cherry picked from commit d2b2f7af4afd4fc817ae404548650182deb9e0ed)
This commit is contained in:
HuyNguyen
2023-06-06 01:30:02 +07:00
committed by Dat Vu
parent 6f3af9100d
commit 9ca0c7385a
4 changed files with 25 additions and 1 deletions
@@ -203,4 +203,9 @@ class EmailDataSourceImpl extends EmailDataSource {
Future<void> deleteSendingEmail(AccountId accountId, UserName userName, String sendingId) {
throw UnimplementedError();
}
@override
Future<void> updateSendingEmail(AccountId accountId, UserName userName, SendingEmail sendingEmail) {
throw UnimplementedError();
}
}
@@ -267,4 +267,11 @@ class EmailHiveCacheDataSourceImpl extends EmailDataSource {
return await _sendingEmailCacheManager.deleteSendingEmail(accountId, userName, sendingId);
}).catchError(_exceptionThrower.throwException);
}
@override
Future<void> updateSendingEmail(AccountId accountId, UserName userName, SendingEmail sendingEmail) {
return Future.sync(() async {
return await _sendingEmailCacheManager.updateSendingEmail(accountId, userName, sendingEmail.toHiveCache());
}).catchError(_exceptionThrower.throwException);
}
}