From fb80d1dbe88614a53b7fd4e61b08b5e1cd296c7e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 10 Jan 2019 21:39:45 -0800 Subject: WIP on annotations and changes --- rust/src/editing.rs | 60 +++++++++++++++++++---------------------------------- 1 file changed, 21 insertions(+), 39 deletions(-) (limited to 'rust/src/editing.rs') diff --git a/rust/src/editing.rs b/rust/src/editing.rs index 4fca30d6..2feff837 100644 --- a/rust/src/editing.rs +++ b/rust/src/editing.rs @@ -60,45 +60,6 @@ pub fn make_edit_context( }) } -pub fn create_editor( - conn: &DbConn, - username: String, - is_admin: bool, - is_bot: bool, -) -> Result { - check_username(&username)?; - let ed: EditorRow = diesel::insert_into(editor::table) - .values(( - editor::username.eq(username), - editor::is_admin.eq(is_admin), - editor::is_bot.eq(is_bot), - )) - .get_result(conn)?; - Ok(ed) -} - -pub fn update_editor_username( - conn: &DbConn, - editor_id: FatcatId, - username: String, -) -> Result { - check_username(&username)?; - diesel::update(editor::table.find(editor_id.to_uuid())) - .set(editor::username.eq(username)) - .execute(conn)?; - let editor: EditorRow = editor::table.find(editor_id.to_uuid()).get_result(conn)?; - Ok(editor) -} - -/// This function should always be run within a transaction -pub fn create_editgroup(conn: &DbConn, editor_id: Uuid) -> Result { - // need to insert and update - let eg_row: EditgroupRow = diesel::insert_into(editgroup::table) - .values((editgroup::editor_id.eq(editor_id),)) - .get_result(conn)?; - Ok(eg_row.id) -} - /// This function should always be run within a transaction pub fn accept_editgroup(conn: &DbConn, editgroup_id: FatcatId) -> Result { // check that we haven't accepted already (in changelog) @@ -128,3 +89,24 @@ pub fn accept_editgroup(conn: &DbConn, editgroup_id: FatcatId) -> Result Result { + unimplemented!() +} + +pub fn create_editor( + conn: &DbConn, + username: String, + is_admin: bool, + is_bot: bool, +) -> Result { + unimplemented!() +} + +pub fn update_editor_username( + conn: &DbConn, + editor_id: FatcatId, + username: String, +) -> Result { + unimplemented!() +} -- cgit v1.2.3