dashboard and testing stuff

This commit is contained in:
dal 2025-03-18 23:51:52 -06:00
parent cef57963f7
commit c53177d3ee
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
2 changed files with 10 additions and 1 deletions

View File

@ -25,7 +25,15 @@ pub async fn fetch_dashboard_file(id: &Uuid) -> Result<Option<DashboardFile>> {
.first::<DashboardFile>(&mut conn)
.await
{
Ok(result) => Some(result),
Ok(mut result) => {
// Ensure all rows have IDs (for backwards compatibility)
for (index, row) in result.content.rows.iter_mut().enumerate() {
if row.id.is_none() {
row.id = Some((index as u32) + 1);
}
}
Some(result)
},
Err(diesel::NotFound) => None,
Err(e) => return Err(e.into()),
};

View File

@ -116,6 +116,7 @@ pub async fn create_test_dashboard(organization_id: Uuid, created_by: Uuid) -> R
name: "Test Dashboard".to_string(),
description: Some("Test dashboard description".to_string()),
rows: vec![database::types::Row {
id: None,
items: vec![database::types::RowItem { id: Uuid::new_v4() }],
row_height: Some(320),
column_sizes: None,