Skip to content

Commit

Permalink
Fix replace authId with doc id
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasatisocco committed Jul 25, 2023
1 parent 18b7a3e commit 21aa8a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AdminUsersCubit extends Cubit<AdminUsersState> {
_firestoreRepository.listenUserList().listen((snapshots) {
final users = snapshots.docs
.map(
(e) => UserDataModel.fromMap(e.data()).copyWith(authId: e.id),
(e) => UserDataModel.fromMap(e.data()),
)
.toList();
UserDataModel? user;
Expand Down Expand Up @@ -110,7 +110,7 @@ class AdminUsersCubit extends Cubit<AdminUsersState> {
try {
await _firestoreRepository.updateUser(
user.copyWith(isRead: true).toMap(),
user.authId!,
user.id!,
);
} catch (_) {}
}
Expand All @@ -124,7 +124,7 @@ class AdminUsersCubit extends Cubit<AdminUsersState> {
final updated = user.copyWith(isRead: false);
await _firestoreRepository.updateUser(
updated.toMap(),
user.authId!,
user.id!,
);
} catch (_) {}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/main_development.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ void main() async {
options: DefaultFirebaseOptions.currentPlatform,
);

final firestoreRepository = FirestoreRepository.production();
final storageRepository = StorageRepository.production();
final firestoreRepository = FirestoreRepository.development();
final storageRepository = StorageRepository.development();
final dataPersistenceRepository = DataPersistenceRepository();
final remoteConfigurations = RemoteConfigurations();
final authRepository = AuthRepository();
Expand Down

0 comments on commit 21aa8a6

Please sign in to comment.