mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 11:00:36 +00:00
feat: always send target info
This commit is contained in:
parent
3272f8aa88
commit
a2865523a0
4 changed files with 4 additions and 5 deletions
|
@ -135,7 +135,7 @@ pub async fn get_package_version(
|
||||||
let mut response = serde_json::to_value(PackageResponse {
|
let mut response = serde_json::to_value(PackageResponse {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
version: v_id.version().to_string(),
|
version: v_id.version().to_string(),
|
||||||
target: Some(entry.target.into()),
|
target: entry.target.into(),
|
||||||
description: entry.description.unwrap_or_default(),
|
description: entry.description.unwrap_or_default(),
|
||||||
published_at: entry.published_at,
|
published_at: entry.published_at,
|
||||||
license: entry.license.unwrap_or_default(),
|
license: entry.license.unwrap_or_default(),
|
||||||
|
|
|
@ -27,7 +27,7 @@ pub async fn get_package_versions(
|
||||||
.map(|(v_id, entry)| PackageResponse {
|
.map(|(v_id, entry)| PackageResponse {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
version: v_id.version().to_string(),
|
version: v_id.version().to_string(),
|
||||||
target: Some(entry.target.into()),
|
target: entry.target.into(),
|
||||||
description: entry.description.unwrap_or_default(),
|
description: entry.description.unwrap_or_default(),
|
||||||
published_at: entry.published_at,
|
published_at: entry.published_at,
|
||||||
license: entry.license.unwrap_or_default(),
|
license: entry.license.unwrap_or_default(),
|
||||||
|
|
|
@ -84,7 +84,7 @@ pub async fn search_packages(
|
||||||
PackageResponse {
|
PackageResponse {
|
||||||
name: id.to_string(),
|
name: id.to_string(),
|
||||||
version: version_id.version().to_string(),
|
version: version_id.version().to_string(),
|
||||||
target: None,
|
target: entry.target.into(),
|
||||||
description: entry.description.unwrap_or_default(),
|
description: entry.description.unwrap_or_default(),
|
||||||
published_at: entry.published_at,
|
published_at: entry.published_at,
|
||||||
license: entry.license.unwrap_or_default(),
|
license: entry.license.unwrap_or_default(),
|
||||||
|
|
|
@ -34,8 +34,7 @@ impl From<Target> for TargetInfo {
|
||||||
pub struct PackageResponse {
|
pub struct PackageResponse {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub version: String,
|
pub version: String,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
pub target: TargetInfo,
|
||||||
pub target: Option<TargetInfo>,
|
|
||||||
#[serde(skip_serializing_if = "String::is_empty")]
|
#[serde(skip_serializing_if = "String::is_empty")]
|
||||||
pub description: String,
|
pub description: String,
|
||||||
pub published_at: DateTime<Utc>,
|
pub published_at: DateTime<Utc>,
|
||||||
|
|
Loading…
Reference in a new issue