diff --git a/Sources/App/Management/TableManagement.swift b/Sources/App/Management/TableManagement.swift index 6de7c25..15aaf13 100644 --- a/Sources/App/Management/TableManagement.swift +++ b/Sources/App/Management/TableManagement.swift @@ -113,8 +113,9 @@ final class TableManagement { player.$table.id = nil guard let table = WaitingTable(oldTable: oldTable, removing: player.name) else { tables[oldTable.id] = nil - return Table.query(on: database).filter(\.$id == oldTable.id).delete().flatMap { - player.update(on: database) + return player.update(on: database).flatMap { + 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