Implemented bulk cipher share (share selected) #100

This commit is contained in:
Kumar Ankur
2018-08-06 03:29:44 +05:30
parent 8ffa7ebb6a
commit ddda86b90d
3 changed files with 68 additions and 5 deletions

View File

@@ -111,4 +111,10 @@ impl Attachment {
.filter(attachments::cipher_uuid.eq(cipher_uuid))
.load::<Self>(&**conn).expect("Error loading attachments")
}
pub fn find_by_ciphers(cipher_uuids: Vec<String>, conn: &DbConn) -> Vec<Self> {
attachments::table
.filter(attachments::cipher_uuid.eq_any(cipher_uuids))
.load::<Self>(&**conn).expect("Error loading attachments")
}
}