diff --git a/backend/src/api/list.rs b/backend/src/api/list.rs index b95373e..8a3be25 100644 --- a/backend/src/api/list.rs +++ b/backend/src/api/list.rs @@ -51,9 +51,10 @@ pub struct ListPackageModel { } #[openapi(tag = "test")] -#[get("/packages/list")] +#[get("/packages/list?")] pub async fn package_list( db: &State, + limit: Option, ) -> Result>, NotFound> { let db = db as &DatabaseConnection; @@ -67,6 +68,8 @@ pub async fn package_list( .column_as(packages::Column::LatestAurVersion, "latest_aur_version") .column_as(versions::Column::Version, "latest_version") .column_as(packages::Column::LatestVersionId, "latest_version_id") + .order_by(packages::Column::Id, Order::Desc) + .limit(limit) .into_model::() .all(db) .await diff --git a/backend/src/builder/builder.rs b/backend/src/builder/builder.rs index 9dfdc2f..560af79 100644 --- a/backend/src/builder/builder.rs +++ b/backend/src/builder/builder.rs @@ -70,7 +70,7 @@ async fn queue_package( new_build.status = Set(Some(0)); new_build = new_build.save(&db).await.unwrap(); - build_package(new_build, db, version_model, version, name, url).await; + let _ = build_package(new_build, db, version_model, version, name, url).await; }); Ok(()) }