From 9cd400db6c5da858a4f49eb883469cbd6cb7337d Mon Sep 17 00:00:00 2001 From: Mathijs van Veluw Date: Sat, 14 Dec 2024 00:55:34 +0100 Subject: 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 --- src/db/models/folder.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/db/models/folder.rs') 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 { + pub async fn find_by_uuid_and_user(uuid: &str, user_uuid: &str, conn: &mut DbConn) -> Option { db_run! { conn: { folders::table .filter(folders::uuid.eq(uuid)) + .filter(folders::user_uuid.eq(user_uuid)) .first::(conn) .ok() .from_db() -- cgit v1.2.3