Added attachment info per user and some layout fix

- Added the amount and size of the attachments per user
- Changed the items count function a bit
- Some small layout changes
This commit is contained in:
BlackDex
2020-06-03 17:57:03 +02:00
parent 5c54dfee3a
commit 2fffaec226
4 changed files with 25 additions and 5 deletions

View File

@ -355,12 +355,13 @@ impl Cipher {
.load::<Self>(&**conn).expect("Error loading ciphers")
}
pub fn count_owned_by_user(user_uuid: &str, conn: &DbConn) -> Option<i64> {
pub fn count_owned_by_user(user_uuid: &str, conn: &DbConn) -> i64 {
ciphers::table
.filter(ciphers::user_uuid.eq(user_uuid))
.count()
.first::<i64>(&**conn)
.ok()
.unwrap_or(0)
}
pub fn find_by_org(org_uuid: &str, conn: &DbConn) -> Vec<Self> {