diff --git a/src/callers/register.rs b/src/callers/register.rs index a966c01..610f49b 100644 --- a/src/callers/register.rs +++ b/src/callers/register.rs @@ -53,13 +53,13 @@ pub async fn register_user( match repo::user::exists(&pool, &user.username).await { Ok(res) => { if res { - return ( + ( StatusCode::NOT_FOUND, Json(response::Response { message: String::from("Error"), data: vec![user], }), - ); + ) } else { match repo::user::insert(&pool, &user).await { Ok(id) => { diff --git a/src/repo/mod.rs b/src/repo/mod.rs index 709c7fd..951395f 100644 --- a/src/repo/mod.rs +++ b/src/repo/mod.rs @@ -13,7 +13,7 @@ pub mod user { SELECT 1 FROM "user" WHERE username = $1 "#, ) - .bind(&username) + .bind(username) .fetch_optional(pool) .await;