Fix delete empty table
This commit is contained in:
parent
176c5753d7
commit
1d1044c3f8
@ -113,8 +113,9 @@ final class TableManagement {
|
|||||||
player.$table.id = nil
|
player.$table.id = nil
|
||||||
guard let table = WaitingTable(oldTable: oldTable, removing: player.name) else {
|
guard let table = WaitingTable(oldTable: oldTable, removing: player.name) else {
|
||||||
tables[oldTable.id] = nil
|
tables[oldTable.id] = nil
|
||||||
return Table.query(on: database).filter(\.$id == oldTable.id).delete().flatMap {
|
return player.update(on: database).flatMap {
|
||||||
player.update(on: database)
|
print("Updating player")
|
||||||
|
return Table.query(on: database).filter(\.$id == oldTable.id).delete()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// `player.canStartGame` is automatically set to false, because table is not full
|
/// `player.canStartGame` is automatically set to false, because table is not full
|
||||||
|
Loading…
Reference in New Issue
Block a user