Skip to content

Commit 8223f97

Browse files
committed
chore: merge fixes
1 parent 4301484 commit 8223f97

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

packages/stream_chat_persistence/lib/src/dao/poll_vote_dao.dart

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,6 @@ class PollVoteDao extends DatabaseAccessor<DriftChatDatabase> with _$PollVoteDao
6060
return grouped;
6161
}
6262

63-
/// Returns poll votes for every id in [pollIds], grouped by poll id.
64-
Future<Map<String, List<PollVote>>> getPollVotesForPolls(
65-
List<String> pollIds,
66-
) async {
67-
if (pollIds.isEmpty) return const {};
68-
final grouped = <String, List<PollVote>>{
69-
for (final id in pollIds) id: <PollVote>[],
70-
};
71-
for (final chunk in chunked(pollIds)) {
72-
final where = pollVotes.pollId.isIn(chunk);
73-
final rows = await (select(pollVotes).join([
74-
leftOuterJoin(users, pollVotes.userId.equalsExp(users.id)),
75-
])
76-
..where(where)
77-
..orderBy([OrderingTerm.asc(pollVotes.createdAt)]))
78-
.map((row) {
79-
final userEntity = row.readTableOrNull(users);
80-
final pollVoteEntity = row.readTable(pollVotes);
81-
return pollVoteEntity.toPollVote(user: userEntity?.toUser());
82-
}).get();
83-
for (final v in rows) {
84-
grouped[v.pollId]!.add(v);
85-
}
86-
}
87-
return grouped;
88-
}
89-
9063
/// Updates the poll votes data with the new [pollVoteList] data
9164
Future<void> updatePollVotes(List<PollVote> pollVoteList) => batch(
9265
(it) => it.insertAllOnConflictUpdate(

0 commit comments

Comments
 (0)