summaryrefslogtreecommitdiffstats
path: root/rust/src/entity_crud.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-14 18:29:51 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-14 18:29:51 -0700
commita69fb6bfd45b99a2001a12524714fc2542a6d9ca (patch)
treeb6b100d2fc235b439c98ad9f1ee4915b5ac83660 /rust/src/entity_crud.rs
parent7c18e1d22b16bb920c9bb9a788691820bbdb2bfa (diff)
downloadfatcat-a69fb6bfd45b99a2001a12524714fc2542a6d9ca.tar.gz
fatcat-a69fb6bfd45b99a2001a12524714fc2542a6d9ca.zip
rust: return editors and cl index for editgroup more often
Diffstat (limited to 'rust/src/entity_crud.rs')
-rw-r--r--rust/src/entity_crud.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/rust/src/entity_crud.rs b/rust/src/entity_crud.rs
index bdb83560..269bfdf6 100644
--- a/rust/src/entity_crud.rs
+++ b/rust/src/entity_crud.rs
@@ -538,9 +538,10 @@ macro_rules! generic_db_get_history {
) -> Result<Vec<EntityHistoryEntry>> {
let limit = limit.unwrap_or(50); // TODO: make a static
- let rows: Vec<(EditgroupRow, ChangelogRow, Self::EditRow)> = editgroup::table
+ let rows: Vec<(EditgroupRow, ChangelogRow, Self::EditRow, EditorRow)> = editgroup::table
.inner_join(changelog::table)
.inner_join($edit_table::table)
+ .inner_join(editor::table)
.filter($edit_table::ident_id.eq(ident.to_uuid()))
.order(changelog::id.desc())
.limit(limit)
@@ -548,10 +549,11 @@ macro_rules! generic_db_get_history {
let history: Result<Vec<EntityHistoryEntry>> = rows
.into_iter()
- .map(|(eg_row, cl_row, e_row)| {
+ .map(|(eg_row, cl_row, e_row, editor_row)| {
+ let editor = editor_row.into_model();
Ok(EntityHistoryEntry {
edit: e_row.into_model()?,
- editgroup: eg_row.into_model_partial(None),
+ editgroup: eg_row.into_model_partial(Some(cl_row.id), Some(editor)),
changelog_entry: cl_row.into_model(),
})
})