Skip to content

Commit

Permalink
simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Nov 23, 2024
1 parent 5d6c54e commit 0fd0cc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
11 changes: 2 additions & 9 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
23 changes: 10 additions & 13 deletions src/endpoints/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -72,12 +74,7 @@ struct CreateVersionBody {
#[serde(default)]
pub prerelease: bool,
pub commit_hash: String,
#[serde(default)]
pub win: Option<GDVersionEnum>,
#[serde(default)]
pub mac: Option<GDVersionEnum>,
#[serde(default)]
pub android: Option<GDVersionEnum>,
pub gd: DetailedGDVersion,
}

#[post("v1/loader/versions")]
Expand All @@ -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()
Expand Down

0 comments on commit 0fd0cc8

Please sign in to comment.