Skip to content

Commit

Permalink
chore: add keywords and authors to collection children
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Nov 27, 2023
1 parent 74646a2 commit a6b29b3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "writing"
version = "1.3.17"
version = "1.3.18"
edition = "2021"
rust-version = "1.64"
description = ""
Expand Down
12 changes: 12 additions & 0 deletions src/api/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,8 @@ pub struct CollectionChildrenOutput {
pub version: i16,
pub title: String,
pub summary: String,
pub keywords: Vec<String>,
pub authors: Vec<String>,
}

pub async fn list_children(
Expand Down Expand Up @@ -993,6 +995,8 @@ pub async fn list_children(
"summary".to_string(),
"cover".to_string(),
"updated_at".to_string(),
"keywords".to_string(),
"authors".to_string(),
];

for child in children {
Expand Down Expand Up @@ -1020,6 +1024,8 @@ pub async fn list_children(
output.language = to.with(lang);
output.title = info.title;
output.summary = info.summary;
output.keywords = info.keywords.unwrap_or_default();
output.authors = info.authors.unwrap_or_default();
}
output.gid = to.with(doc.gid);
output.rating = doc.rating;
Expand Down Expand Up @@ -1056,6 +1062,8 @@ pub async fn list_children(
output.summary = doc.summary;
output.cover = doc.cover;
output.kind = 1;
output.keywords = doc.keywords;
output.authors = doc.authors;
}
} else {
let mut doc = db::Creation::with_pk(icreation.gid, icreation.id);
Expand All @@ -1074,6 +1082,8 @@ pub async fn list_children(
output.summary = doc.summary;
output.cover = doc.cover;
output.kind = 0;
output.keywords = doc.keywords;
output.authors = doc.authors;
}
}
} else if let Ok(ipub) = db::PublicationIndex::get_implicit_published(
Expand All @@ -1100,6 +1110,8 @@ pub async fn list_children(
output.summary = doc.summary;
output.cover = doc.cover;
output.kind = 1;
output.keywords = doc.keywords;
output.authors = doc.authors;
}
}
}
Expand Down

0 comments on commit a6b29b3

Please sign in to comment.