Fix deck data collecting

This commit is contained in:
micialware committed 2026-08-20 16:22:38 +03:00
1 parent c5e91b844c
commit 3f43676580
4 files changed
+63 -22

No files matched your search

+10
View File
@@ -81,3 +81,13 @@ pub fn delete_stat(stat: &CardStatistics, connection: &Connection) {
.execute("DELETE FROM card_stats WHERE id = ?1", (&stat.id,))
.unwrap();
}
pub fn delete_stats(stat: &[CardStatistics], connection: &Connection) {
if stat.is_empty() {
return;
}
let ids = stat.iter().map(|s| s.id.into()).collect::<Vec<String>>().join(", ");
connection
.execute(format!("DELETE FROM card_stats WHERE id in {ids}").as_str(), ())
.unwrap();
}