summaryrefslogtreecommitdiffstats
path: root/rust/src/api_server.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-11 16:10:47 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-11 16:10:47 -0700
commit91c080a2e82ec4e8908cb8e3916a543519151847 (patch)
tree1d6f450546bcd0d0888bd0f4ec52d66a8a3cfd0f /rust/src/api_server.rs
parent6315c314969d4e66db4da09a8c2ff245aafe0fc1 (diff)
downloadfatcat-91c080a2e82ec4e8908cb8e3916a543519151847.tar.gz
fatcat-91c080a2e82ec4e8908cb8e3916a543519151847.zip
implement new editgroup_id behavior
Diffstat (limited to 'rust/src/api_server.rs')
-rw-r--r--rust/src/api_server.rs14
1 files changed, 3 insertions, 11 deletions
diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs
index f25e6169..055758e0 100644
--- a/rust/src/api_server.rs
+++ b/rust/src/api_server.rs
@@ -19,15 +19,11 @@ macro_rules! entity_batch_handler {
&self,
entity_list: &[models::$model],
autoaccept: bool,
- editgroup: Option<String>,
+ editgroup_id: Option<FatCatId>,
conn: &DbConn,
) -> Result<Vec<EntityEdit>> {
- let editgroup_id: Option<FatCatId> = match editgroup {
- Some(s) => Some(FatCatId::from_str(&s)?),
- None => None,
- };
- let edit_context = make_edit_context(conn, editgroup_id.clone(), autoaccept)?;
+ let edit_context = make_edit_context(conn, editgroup_id, autoaccept)?;
let model_list: Vec<&models::$model> = entity_list.iter().map(|e| e).collect();
let edits = $model::db_create_batch(conn, &edit_context, model_list.as_slice())?;
@@ -57,10 +53,7 @@ pub struct Server {
pub db_pool: ConnectionPool,
}
-pub fn get_release_files (
- id: FatCatId,
- conn: &DbConn,
-) -> Result<Vec<FileEntity>> {
+pub fn get_release_files(id: FatCatId, conn: &DbConn) -> Result<Vec<FileEntity>> {
let rows: Vec<(FileRevRow, FileIdentRow, FileReleaseRow)> = file_rev::table
.inner_join(file_ident::table)
.inner_join(file_release::table)
@@ -75,7 +68,6 @@ pub fn get_release_files (
}
impl Server {
-
pub fn lookup_container_handler(&self, issnl: &str, conn: &DbConn) -> Result<ContainerEntity> {
check_issn(issnl)?;
let (ident, rev): (ContainerIdentRow, ContainerRevRow) = container_ident::table