TF-3767 Use TupleKey to save recent search for each account
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/user_name.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/data/datasource/search_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/model/recent_search.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/repository/search_repository.dart';
|
||||
@@ -10,12 +12,28 @@ class SearchRepositoryImpl extends SearchRepository {
|
||||
SearchRepositoryImpl(this.searchDataSource);
|
||||
|
||||
@override
|
||||
Future<void> saveRecentSearch(RecentSearch recentSearch) {
|
||||
return searchDataSource.saveRecentSearch(recentSearch);
|
||||
Future<void> saveRecentSearch(
|
||||
AccountId accountId,
|
||||
UserName userName,
|
||||
RecentSearch recentSearch,
|
||||
) {
|
||||
return searchDataSource.saveRecentSearch(accountId, userName, recentSearch);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<RecentSearch>> getAllRecentSearchLatest({int? limit, String? pattern}) {
|
||||
return searchDataSource.getAllRecentSearchLatest(limit: limit, pattern: pattern);
|
||||
Future<List<RecentSearch>> getAllRecentSearchLatest(
|
||||
AccountId accountId,
|
||||
UserName userName,
|
||||
{
|
||||
int? limit,
|
||||
String? pattern,
|
||||
}
|
||||
) {
|
||||
return searchDataSource.getAllRecentSearchLatest(
|
||||
accountId,
|
||||
userName,
|
||||
limit: limit,
|
||||
pattern: pattern,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user