diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-21 14:10:56 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-21 14:10:56 -0800 |
commit | 1a15624e13bfe0a3bdddb1f0c5bf8940c9f04a04 (patch) | |
tree | 02029146a5bc5079ec2c85dc7dc88c47a69a5352 /rust/src/api_wrappers.rs | |
parent | 42265350c9f0b7a5731103c191a807a691f8f2ef (diff) | |
download | fatcat-1a15624e13bfe0a3bdddb1f0c5bf8940c9f04a04.tar.gz fatcat-1a15624e13bfe0a3bdddb1f0c5bf8940c9f04a04.zip |
more edit edgecases; editgroup status check
Diffstat (limited to 'rust/src/api_wrappers.rs')
-rw-r--r-- | rust/src/api_wrappers.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rust/src/api_wrappers.rs b/rust/src/api_wrappers.rs index aa7f9ec3..fe9cd793 100644 --- a/rust/src/api_wrappers.rs +++ b/rust/src/api_wrappers.rs @@ -36,7 +36,7 @@ macro_rules! wrap_entity_handlers { _context: &Context, ) -> Box<Future<Item = $get_resp, Error = ApiError> + Send> { let conn = self.db_pool.get().expect("db_pool error"); - // No transaction for GET? + // No transaction for GET let ret = match (|| { let entity_id = FatCatId::from_str(&id)?; let hide_flags = match hide { @@ -88,6 +88,7 @@ macro_rules! wrap_entity_handlers { Some(FatCatId::from_str(&s)?) } else { None }; let edit_context = make_edit_context(&conn, editgroup_id, false)?; + edit_context.check(&conn)?; entity.db_create(&conn, &edit_context)?.into_model() }) { Ok(edit) => @@ -168,6 +169,7 @@ macro_rules! wrap_entity_handlers { Some(FatCatId::from_str(&s)?) } else { None }; let edit_context = make_edit_context(&conn, editgroup_id, false)?; + edit_context.check(&conn)?; entity.db_update(&conn, &edit_context, entity_id)?.into_model() }) { Ok(edit) => @@ -213,6 +215,7 @@ macro_rules! wrap_entity_handlers { None => None, }; let edit_context = make_edit_context(&conn, editgroup_id, false)?; + edit_context.check(&conn)?; $model::db_delete(&conn, &edit_context, entity_id)?.into_model() }) { Ok(edit) => |