TF-1311 Add capability of Team-Mailbox for GetMailboxMethod
This commit is contained in:
@@ -20,7 +20,7 @@ import 'package:tmail_ui_user/features/mailbox/domain/model/subscribe_mailbox_re
|
||||
abstract class MailboxRepository {
|
||||
Stream<MailboxResponse> getAllMailbox(Session session, AccountId accountId, {Properties? properties});
|
||||
|
||||
Stream<MailboxResponse> refresh(AccountId accountId, State currentState);
|
||||
Stream<MailboxResponse> refresh(Session session, AccountId accountId, State currentState);
|
||||
|
||||
Future<Mailbox?> createNewMailbox(AccountId accountId, CreateNewMailboxRequest newMailboxRequest);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/session/session.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart' as jmapState;
|
||||
import 'package:model/model.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/domain/model/mailbox_response.dart';
|
||||
@@ -12,12 +13,12 @@ class RefreshAllMailboxInteractor {
|
||||
|
||||
RefreshAllMailboxInteractor(this._mailboxRepository);
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, jmapState.State currentState) async* {
|
||||
Stream<Either<Failure, Success>> execute(Session session, AccountId accountId, jmapState.State currentState) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(RefreshingState());
|
||||
|
||||
yield* _mailboxRepository
|
||||
.refresh(accountId, currentState)
|
||||
.refresh(session, accountId, currentState)
|
||||
.map(_toGetMailboxState);
|
||||
} catch (e) {
|
||||
yield Left<Failure, Success>(RefreshChangesAllMailboxFailure(e));
|
||||
|
||||
Reference in New Issue
Block a user