only 1 version on creation

This commit is contained in:
dal 2025-04-22 21:35:44 -06:00
parent f3b44aa7a0
commit d6c0bee096
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
1 changed files with 3 additions and 4 deletions

View File

@ -45,9 +45,8 @@ pub async fn create_dashboard_handler(user: &AuthenticatedUser) -> Result<Buster
// Current timestamp // Current timestamp
let now = Utc::now(); let now = Utc::now();
// Create version history with initial version // Create version history with initial version 1
let mut version_history = VersionHistory::new(0, dashboard_yml.clone()); let version_history = VersionHistory::new(1, dashboard_yml);
version_history.add_version(1, dashboard_yml);
// Insert the dashboard file // Insert the dashboard file
let dashboard_file = insert_into(dashboard_files::table) let dashboard_file = insert_into(dashboard_files::table)
@ -113,7 +112,7 @@ pub async fn create_dashboard_handler(user: &AuthenticatedUser) -> Result<Buster
file_name: dashboard_file.2, file_name: dashboard_file.2,
}; };
// Create initial version // Create initial version details for the response
let initial_version = Version { let initial_version = Version {
version_number: 1, version_number: 1,
updated_at: now, updated_at: now,