Refactored tests in own files
Some checks failed
Pull Request Pipeline / test (pull_request) Failing after 2m5s
Pull Request Pipeline / lint (pull_request) Successful in 2m5s

This commit is contained in:
2025-11-21 01:05:35 +01:00
parent b21ca54672
commit 961c6bb679
7 changed files with 394 additions and 159 deletions

View File

@@ -64,8 +64,15 @@ class GroupGameDao extends DatabaseAccessor<AppDatabase>
return (count ?? 0) > 0;
}
Future<bool> removeGroupFromGame({required String gameId}) async {
final query = delete(groupGameTable)..where((g) => g.gameId.equals(gameId));
/// Removes the association of a group from a game based on [groupId] and
/// [gameId].
/// Returns `true` if more than 0 rows were affected, otherwise `false`.
Future<bool> removeGroupFromGame({
required String gameId,
required String groupId,
}) async {
final query = delete(groupGameTable)
..where((g) => g.gameId.equals(gameId) & g.groupId.equals(groupId));
final rowsAffected = await query.go();
return rowsAffected > 0;
}