mirror of https://github.com/buster-so/buster.git
dashboard and testing stuff
This commit is contained in:
parent
cef57963f7
commit
c53177d3ee
|
@ -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()),
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue