You've already forked AstralRinth
forked from didirus/AstralRinth
Make changelog in version response optional (#5115)
* Make changelog on version routes optional * fix clippy * fix ci
This commit is contained in:
@@ -37,6 +37,12 @@ pub struct VersionListFilters {
|
||||
pub version_type: Option<VersionType>,
|
||||
pub limit: Option<usize>,
|
||||
pub offset: Option<usize>,
|
||||
#[serde(default = "default_true")]
|
||||
pub include_changelog: bool,
|
||||
}
|
||||
|
||||
fn default_true() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[get("version")]
|
||||
@@ -95,6 +101,7 @@ pub async fn version_list(
|
||||
version_type: filters.version_type,
|
||||
limit: filters.limit,
|
||||
offset: filters.offset,
|
||||
include_changelog: filters.include_changelog,
|
||||
};
|
||||
|
||||
let response = v3::versions::version_list(
|
||||
@@ -153,6 +160,8 @@ pub async fn version_project_get(
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct VersionIds {
|
||||
pub ids: String,
|
||||
#[serde(default = "default_true")]
|
||||
pub include_changelog: bool,
|
||||
}
|
||||
|
||||
#[get("versions")]
|
||||
@@ -163,7 +172,10 @@ pub async fn versions_get(
|
||||
redis: web::Data<RedisPool>,
|
||||
session_queue: web::Data<AuthQueue>,
|
||||
) -> Result<HttpResponse, ApiError> {
|
||||
let ids = v3::versions::VersionIds { ids: ids.ids };
|
||||
let ids = v3::versions::VersionIds {
|
||||
ids: ids.ids,
|
||||
include_changelog: ids.include_changelog,
|
||||
};
|
||||
let response = v3::versions::versions_get(
|
||||
req,
|
||||
web::Query(ids),
|
||||
|
||||
Reference in New Issue
Block a user