TF-1317 Update authentication account to store AccountId
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:model/account/account.dart';
|
||||
import 'package:model/account/authentication_type.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/model/account_cache.dart';
|
||||
@@ -15,6 +17,12 @@ extension AccountCacheExtension on AccountCache {
|
||||
|
||||
Account toAccount() {
|
||||
final authenticationType = fromAuthenticationTypeString();
|
||||
return Account(id, authenticationType, isSelected: isSelected);
|
||||
return Account(
|
||||
id,
|
||||
authenticationType,
|
||||
isSelected: isSelected,
|
||||
accountId: accountId != null ? AccountId(Id(accountId!)) : null,
|
||||
apiUrl: apiUrl
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,12 @@ import 'package:tmail_ui_user/features/login/data/model/account_cache.dart';
|
||||
|
||||
extension AccountExtensions on Account {
|
||||
AccountCache toCache() {
|
||||
return AccountCache(id, authenticationType.asString(), isSelected: isSelected);
|
||||
return AccountCache(
|
||||
id,
|
||||
authenticationType.asString(),
|
||||
isSelected: isSelected,
|
||||
accountId: accountId?.id.value,
|
||||
apiUrl: apiUrl
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user