MVP #141
@@ -24,7 +24,7 @@ class GameDao extends DatabaseAccessor<AppDatabase> with _$GameDaoMixin {
|
|||||||
final result = await query.getSingle();
|
final result = await query.getSingle();
|
||||||
|
|
||||||
List<Player>? players;
|
List<Player>? players;
|
||||||
if (await db.playerGameDao.hasGamePlayers(gameId: gameId)) {
|
if (await db.playerGameDao.gameHasPlayers(gameId: gameId)) {
|
||||||
players = await db.playerGameDao.getPlayersByGameId(gameId: gameId);
|
players = await db.playerGameDao.getPlayersByGameId(gameId: gameId);
|
||||||
}
|
}
|
||||||
Group? group;
|
Group? group;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class PlayerGameDao extends DatabaseAccessor<AppDatabase>
|
|||||||
|
|
||||||
/// Checks if there are any players associated with the given [gameId].
|
/// Checks if there are any players associated with the given [gameId].
|
||||||
/// Returns `true` if there are players, otherwise `false`.
|
/// Returns `true` if there are players, otherwise `false`.
|
||||||
Future<bool> hasGamePlayers({required String gameId}) async {
|
Future<bool> gameHasPlayers({required String gameId}) async {
|
||||||
final count =
|
final count =
|
||||||
await (selectOnly(playerGameTable)
|
await (selectOnly(playerGameTable)
|
||||||
..where(playerGameTable.gameId.equals(gameId))
|
..where(playerGameTable.gameId.equals(gameId))
|
||||||
|
|||||||
Reference in New Issue
Block a user