summaryrefslogtreecommitdiffstats
path: root/rust/src/endpoints.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-11 17:47:52 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-11 17:47:52 -0800
commit2ee844b75c611ae32f40f1d65dcb00f3de553240 (patch)
tree0a763b7fd60ab9c463748fe5294b8b14c7ad4911 /rust/src/endpoints.rs
parent21a932b6412cfa9610d3d40c95b34be6e52a97ce (diff)
downloadfatcat-2ee844b75c611ae32f40f1d65dcb00f3de553240.tar.gz
fatcat-2ee844b75c611ae32f40f1d65dcb00f3de553240.zip
cleanups and TODOs
Diffstat (limited to 'rust/src/endpoints.rs')
-rw-r--r--rust/src/endpoints.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/rust/src/endpoints.rs b/rust/src/endpoints.rs
index 33c4bc3e..f7e93448 100644
--- a/rust/src/endpoints.rs
+++ b/rust/src/endpoints.rs
@@ -754,7 +754,10 @@ impl Api for Server {
let limit = cmp::min(100, limit.unwrap_or(20)) as u64;
let rows =
Editgroup::db_get_range_for_editor(&conn, editor_id, limit, since, before)?;
- Ok(rows.into_iter().map(|(eg, cl)| eg.into_model_partial(cl.map(|v| v.id))).collect())
+ Ok(rows
+ .into_iter()
+ .map(|(eg, cl)| eg.into_model_partial(cl.map(|v| v.id)))
+ .collect())
})
.map_err(|e: Error| FatcatError::from(e))
{
@@ -892,8 +895,10 @@ impl Api for Server {
.transaction(|| {
let limit = cmp::min(100, limit.unwrap_or(20)) as u64;
let row = Editgroup::db_get_range_reviewable(&conn, limit, since, before)?;
- let mut editgroups: Vec<Editgroup> =
- row.into_iter().map(|eg| eg.into_model_partial(None)).collect();
+ let mut editgroups: Vec<Editgroup> = row
+ .into_iter()
+ .map(|eg| eg.into_model_partial(None))
+ .collect();
if let Some(expand) = expand {
let expand = ExpandFlags::from_str(&expand)?;
for eg in editgroups.iter_mut() {
@@ -1031,7 +1036,6 @@ impl Api for Server {
annotation.editor_id = Some(auth_context.editor_id.to_string());
}
};
- // TODO: verify editgroup_id
annotation.db_create(&conn).map(|a| a.into_model())
})
.map_err(|e: Error| FatcatError::from(e))