From 59d2094225a9351ddf9a96b07808dcb9e68fdc5d Mon Sep 17 00:00:00 2001 From: lukas-heiligenbrunner Date: Tue, 2 Jan 2024 21:19:23 +0100 Subject: [PATCH] set latest version id when creating new pkg --- backend/src/api/add.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/src/api/add.rs b/backend/src/api/add.rs index fa34c37..61f1502 100644 --- a/backend/src/api/add.rs +++ b/backend/src/api/add.rs @@ -77,10 +77,9 @@ pub async fn package_add( } }; - if pkg_model.status.unwrap() != 0 { - pkg_model.status = Set(0); - pkg_model.save(db).await.expect("todo error message"); - } + pkg_model.status = Set(0); + pkg_model.latest_version_id = Set(Some(version_model.id.clone().unwrap())); + pkg_model.save(db).await.expect("todo error message"); let _ = tx.send(Action::Build( pkg.name,