diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-26 23:26:39 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-26 23:26:39 -0800 |
commit | 0f7fb8806c1a39aa54d0cd051aa48478c1b1c070 (patch) | |
tree | 4e93dd1d39c7fed0f56d7d8ef6b57fea9b60847d /rust/src/api_wrappers.rs | |
parent | 0182cd1456ca1457747ff1363d9d5c5cf95ee2f7 (diff) | |
download | fatcat-0f7fb8806c1a39aa54d0cd051aa48478c1b1c070.tar.gz fatcat-0f7fb8806c1a39aa54d0cd051aa48478c1b1c070.zip |
impl edit_id change
Diffstat (limited to 'rust/src/api_wrappers.rs')
-rw-r--r-- | rust/src/api_wrappers.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rust/src/api_wrappers.rs b/rust/src/api_wrappers.rs index aa168076..cf696d15 100644 --- a/rust/src/api_wrappers.rs +++ b/rust/src/api_wrappers.rs @@ -327,12 +327,13 @@ macro_rules! wrap_entity_handlers { fn $get_edit_fn( &self, - edit_id: i64, + edit_id: String, _context: &Context, ) -> Box<Future<Item = $get_edit_resp, Error = ApiError> + Send> { let conn = self.db_pool.get().expect("db_pool error"); // No transaction for GET? let ret = match (|| { + let edit_id = Uuid::from_str(&edit_id)?; $model::db_get_edit(&conn, edit_id)?.into_model() })() { Ok(edit) => @@ -351,11 +352,12 @@ macro_rules! wrap_entity_handlers { fn $delete_edit_fn( &self, - edit_id: i64, + edit_id: String, _context: &Context, ) -> Box<Future<Item = $delete_edit_resp, Error = ApiError> + Send> { let conn = self.db_pool.get().expect("db_pool error"); let ret = match conn.transaction(|| { + let edit_id = Uuid::from_str(&edit_id)?; $model::db_delete_edit(&conn, edit_id) }) { Ok(()) => |