TF-3235 Create seach emails in thread API, datasource and repository
This commit is contained in:
@@ -16,6 +16,7 @@ import 'package:tmail_ui_user/features/thread/data/local/email_cache_manager.dar
|
||||
import 'package:tmail_ui_user/features/thread/data/model/email_change_response.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/model/email_response.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/model/filter_message_option.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/model/search_emails_response.dart';
|
||||
import 'package:tmail_ui_user/main/exceptions/exception_thrower.dart';
|
||||
|
||||
class LocalThreadDataSourceImpl extends ThreadDataSource {
|
||||
@@ -40,6 +41,21 @@ class LocalThreadDataSourceImpl extends ThreadDataSource {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SearchEmailsResponse> searchEmails(
|
||||
Session session,
|
||||
AccountId accountId,
|
||||
{
|
||||
UnsignedInt? limit,
|
||||
int? position,
|
||||
Set<Comparator>? sort,
|
||||
Filter? filter,
|
||||
Properties? properties
|
||||
}
|
||||
) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<EmailChangeResponse> getChanges(
|
||||
Session session,
|
||||
|
||||
@@ -18,6 +18,7 @@ import 'package:tmail_ui_user/features/thread/data/network/thread_api.dart';
|
||||
import 'package:tmail_ui_user/features/thread/data/network/thread_isolate_worker.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/model/email_response.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/model/filter_message_option.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/model/search_emails_response.dart';
|
||||
import 'package:tmail_ui_user/main/exceptions/exception_thrower.dart';
|
||||
|
||||
class ThreadDataSourceImpl extends ThreadDataSource {
|
||||
@@ -56,6 +57,30 @@ class ThreadDataSourceImpl extends ThreadDataSource {
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SearchEmailsResponse> searchEmails(
|
||||
Session session,
|
||||
AccountId accountId,
|
||||
{
|
||||
UnsignedInt? limit,
|
||||
int? position,
|
||||
Set<Comparator>? sort,
|
||||
Filter? filter,
|
||||
Properties? properties,
|
||||
}
|
||||
) {
|
||||
return Future.sync(() async {
|
||||
return await threadAPI.searchEmails(
|
||||
session,
|
||||
accountId,
|
||||
limit: limit,
|
||||
position: position,
|
||||
sort: sort,
|
||||
filter: filter,
|
||||
properties: properties);
|
||||
}).catchError(_exceptionThrower.throwException);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<EmailChangeResponse> getChanges(
|
||||
Session session,
|
||||
|
||||
Reference in New Issue
Block a user