set latest version id when creating new pkg

This commit is contained in:
lukas-heiligenbrunner 2024-01-02 21:19:23 +01:00
parent 42095f2fbd
commit 59d2094225

View File

@ -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,