1
0

Version ordering [MOD-551] (#740)

* Version ordering

* cargo sqlx prepare

* Use version ordering for maven

* Use version ordering when sorting versions in Rust (not just SQL)

* Thanks clippy
This commit is contained in:
Jackson Kruger
2023-11-01 11:36:39 -05:00
committed by GitHub
parent d5594b03e3
commit 911d442340
16 changed files with 392 additions and 27 deletions

View File

@@ -76,6 +76,9 @@ pub struct InitialVersionData {
#[validate(length(max = 10))]
#[serde(default)]
pub uploaded_images: Vec<ImageId>,
// The ordering relative to other versions
pub ordering: Option<i32>,
}
#[derive(Serialize, Deserialize, Clone)]
@@ -316,6 +319,7 @@ async fn version_create_inner(
featured: version_create_data.featured,
status: version_create_data.status,
requested_status: None,
ordering: version_create_data.ordering,
});
return Ok(());
@@ -427,6 +431,7 @@ async fn version_create_inner(
version_type: version_data.release_channel,
status: builder.status,
requested_status: builder.requested_status,
ordering: builder.ordering,
files: builder
.files
.iter()