From 019ccda845e69262c2e39fa79b2cd0da85f0ca0c Mon Sep 17 00:00:00 2001 From: "D. Scott Boggs" Date: Sat, 26 Aug 2023 14:50:05 -0400 Subject: [PATCH] Rename variable --- server/src/api/tracks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/api/tracks.rs b/server/src/api/tracks.rs index b168c2d..5d01ea5 100644 --- a/server/src/api/tracks.rs +++ b/server/src/api/tracks.rs @@ -32,7 +32,7 @@ async fn get_track_check_user( track_id: i32, user: &users::Model, ) -> Result, Either> { - if let Some(Some(user)) = user + if let Some(Some(track)) = user .find_related(Tracks) .filter(tracks::Column::Id.eq(track_id)) .one(db) @@ -40,7 +40,7 @@ async fn get_track_check_user( .transpose() .map(|it| it.ok()) { - Ok(Json(user)) + Ok(Json(track)) } else { Err(Left(Status::NotFound)) }