Implement deleting Organization

This commit is contained in:
Miroslav Prasil
2018-05-18 16:52:51 +01:00
parent 726ba36e5b
commit 941747f9e8
4 changed files with 71 additions and 22 deletions

View File

@@ -145,6 +145,13 @@ impl Cipher {
).execute(&**conn).and(Ok(()))
}
pub fn delete_all_by_organization(org_uuid: &str, conn: &DbConn) -> QueryResult<()> {
for cipher in Self::find_by_org(org_uuid, &conn) {
cipher.delete(&conn)?;
}
Ok(())
}
pub fn move_to_folder(&self, folder_uuid: Option<String>, user_uuid: &str, conn: &DbConn) -> Result<(), &str> {
match self.get_folder_uuid(&user_uuid, &conn) {
None => {