aboutsummaryrefslogtreecommitdiff
path: root/src/db/models/folder.rs
diff options
context:
space:
mode:
authorMathijs van Veluw <[email protected]>2024-12-14 00:55:34 +0100
committerGitHub <[email protected]>2024-12-14 00:55:34 +0100
commit9cd400db6c5da858a4f49eb883469cbd6cb7337d (patch)
tree1c1d1900c1e1ba20da64e4c2052285b2d81317e8 /src/db/models/folder.rs
parentfd512300448995735961cbeedcbe4b684be1c5fd (diff)
downloadvaultwarden-9cd400db6c5da858a4f49eb883469cbd6cb7337d.tar.gz
vaultwarden-9cd400db6c5da858a4f49eb883469cbd6cb7337d.zip
Some refactoring and optimizations (#5291)
- Refactored several code to use more modern syntax - Made some checks a bit more strict - Updated crates Signed-off-by: BlackDex <[email protected]>
Diffstat (limited to 'src/db/models/folder.rs')
-rw-r--r--src/db/models/folder.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/db/models/folder.rs b/src/db/models/folder.rs
index 5370c9dd..45460720 100644
--- a/src/db/models/folder.rs
+++ b/src/db/models/folder.rs
@@ -120,10 +120,11 @@ impl Folder {
Ok(())
}
- pub async fn find_by_uuid(uuid: &str, conn: &mut DbConn) -> Option<Self> {
+ pub async fn find_by_uuid_and_user(uuid: &str, user_uuid: &str, conn: &mut DbConn) -> Option<Self> {
db_run! { conn: {
folders::table
.filter(folders::uuid.eq(uuid))
+ .filter(folders::user_uuid.eq(user_uuid))
.first::<FolderDb>(conn)
.ok()
.from_db()