diff --git a/openapi.yml b/openapi.yml index a24e316..8cd959e 100644 --- a/openapi.yml +++ b/openapi.yml @@ -696,15 +696,8 @@ paths: prerelease: required: false type: boolean - win: - required: true - $ref: "#/components/schemas/GDVersionString" - mac: - required: true - $ref: "#/components/schemas/GDVersionString" - android: - required: true - $ref: "#/components/schemas/GDVersionString" + gd: + $ref: "#/components/schemas/GDVersionObject" responses: "204": diff --git a/src/endpoints/loader.rs b/src/endpoints/loader.rs index c98dc9a..de9b8ff 100644 --- a/src/endpoints/loader.rs +++ b/src/endpoints/loader.rs @@ -11,11 +11,13 @@ use crate::{ models::{ gd_version_alias::GDVersionAlias, loader_version::{ - LoaderVersion, - LoaderVersionCreate, - GetVersionsQuery + GetVersionsQuery, LoaderVersion, LoaderVersionCreate }, - mod_gd_version::{GDVersionEnum, VerPlatform} + mod_gd_version::{ + DetailedGDVersion, + GDVersionEnum, + VerPlatform, + } } }, AppData, @@ -72,12 +74,7 @@ struct CreateVersionBody { #[serde(default)] pub prerelease: bool, pub commit_hash: String, - #[serde(default)] - pub win: Option, - #[serde(default)] - pub mac: Option, - #[serde(default)] - pub android: Option, + pub gd: DetailedGDVersion, } #[post("v1/loader/versions")] @@ -98,9 +95,9 @@ pub async fn create_version( tag: payload.tag.trim_start_matches('v').to_string(), prerelease: payload.prerelease, commit_hash: payload.commit_hash.clone(), - win: payload.win.clone(), - mac: payload.mac.clone(), - android: payload.android.clone(), + win: payload.gd.win.clone(), + mac: payload.gd.mac.clone(), + android: payload.gd.android.clone(), }, &mut transaction).await { transaction .rollback()