From 1a15624e13bfe0a3bdddb1f0c5bf8940c9f04a04 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 21 Dec 2018 14:10:56 -0800 Subject: more edit edgecases; editgroup status check --- rust/src/api_wrappers.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rust/src/api_wrappers.rs') 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 + 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) => -- cgit v1.2.3