1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-05-15 16:13:55 +00:00

Some refactoring and optimizations

- Refactored several code to use more modern syntax
- Made some checks a bit more strict
- Updated crates

Signed-off-by: BlackDex <black.dex@gmail.com>
This commit is contained in:
BlackDex 2024-12-13 22:29:14 +01:00
parent fd51230044
commit bec475d5d8
No known key found for this signature in database
GPG key ID: 58C80A2AA6C765E1
23 changed files with 414 additions and 594 deletions

View file

@ -142,16 +142,6 @@ impl OrgPolicy {
}}
}
pub async fn find_by_uuid(uuid: &str, conn: &mut DbConn) -> Option<Self> {
db_run! { conn: {
org_policies::table
.filter(org_policies::uuid.eq(uuid))
.first::<OrgPolicyDb>(conn)
.ok()
.from_db()
}}
}
pub async fn find_by_org(org_uuid: &str, conn: &mut DbConn) -> Vec<Self> {
db_run! { conn: {
org_policies::table