Skip to content

Commit 37ffc93

Browse files
committed
publish: Save description, homepage, documentation and repository fields in the database
1 parent 61e10e2 commit 37ffc93

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/controllers/krate/publish.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ pub async fn publish(app: AppState, req: BytesRequest) -> AppResult<Json<GoodCra
9393

9494
if let Some(deleted_crate) = deleted_crate {
9595
return Err(bad_request(format!(
96-
"A crate with the name `{}` was recently deleted. Reuse of this name will be available after {}.",
97-
deleted_crate.0,
98-
deleted_crate.1.to_rfc3339_opts(SecondsFormat::Secs, true)
99-
)));
96+
"A crate with the name `{}` was recently deleted. Reuse of this name will be available after {}.",
97+
deleted_crate.0,
98+
deleted_crate.1.to_rfc3339_opts(SecondsFormat::Secs, true)
99+
)));
100100
}
101101

102102
// this query should only be used for the endpoint scope calculation
@@ -398,6 +398,10 @@ pub async fn publish(app: AppState, req: BytesRequest) -> AppResult<Json<GoodCra
398398
.has_lib(tarball_info.manifest.lib.is_some())
399399
.bin_names(bin_names.as_slice())
400400
.maybe_edition(edition)
401+
.maybe_description(description.as_deref())
402+
.maybe_homepage(homepage.as_deref())
403+
.maybe_documentation(documentation.as_deref())
404+
.maybe_repository(repository.as_deref())
401405
.build();
402406

403407
let version = new_version.save(conn, &verified_email_address).await.map_err(|error| {

src/models/version.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ pub struct NewVersion<'a> {
9999
pub has_lib: Option<bool>,
100100
pub bin_names: Option<&'a [&'a str]>,
101101
edition: Option<&'a str>,
102+
description: Option<&'a str>,
103+
homepage: Option<&'a str>,
104+
documentation: Option<&'a str>,
105+
repository: Option<&'a str>,
102106
}
103107

104108
impl NewVersion<'_> {

0 commit comments

Comments
 (0)