Change TEXT to INTEGER in card_stats

This commit is contained in:
micialware committed 2026-08-20 18:53:13 +03:00
1 parent e8c9e37ca1
commit 1406fc8f21
5 files changed
+43 -34

No files matched your search

+22 -18
View File
@@ -40,25 +40,29 @@ pub fn load_groups(connection: &Connection) -> ImportData {
.collect::<Vec<(i64, i64)>>();
for (_, collection) in sets {
let fields = collection["flds"]
.as_array()
.unwrap()
.iter()
.map(|x| x["name"].as_str().unwrap().to_string())
.collect();
let mut group = ImportGroup {
id: collection["id"].as_u64().unwrap(),
name: collection["name"].as_str().unwrap().to_string(),
fields,
mapping: Default::default(),
length: 0,
imported: false,
};
if let Some((_, count)) = counts.iter().find(|(id, _)| *id == group.id as i64) {
group.length = *count as u64
let fields_property = collection.get("fields");
if let Some(fields_property) = fields_property {
let fields = fields_property
.as_array()
.unwrap()
.iter()
.map(|x| x["name"].as_str().unwrap().to_string())
.collect();
let mut group = ImportGroup {
id: collection["id"].as_u64().unwrap(),
name: collection["name"].as_str().unwrap().to_string(),
fields,
mapping: Default::default(),
length: 0,
imported: false,
};
if let Some((_, count)) = counts.iter().find(|(id, _)| *id == group.id as i64) {
group.length = *count as u64
}
println!("{:?}", group);
total_data.0.push(group);
}
println!("{:?}", group);
total_data.0.push(group);
}
total_data
}