eliminar e tentativa de partilhar

This commit is contained in:
2026-04-04 01:28:47 +01:00
parent 1b08ed7d07
commit 2544e52636
5 changed files with 169 additions and 56 deletions

View File

@@ -79,7 +79,19 @@ class GameController {
print("Erro ao criar jogo: $e");
return null;
}
}
// ELIMINAR JOGO
Future<bool> deleteGame(String gameId) async {
try {
await _supabase.from('games').delete().eq('id', gameId);
// Como o Supabase tem Cascade Delete (se configurado), vai apagar também
// as stats e shot_locations associadas a este game_id automaticamente.
return true;
} catch (e) {
print("Erro ao eliminar jogo: $e");
return false;
}
}
void dispose() {}
}