From ccfe86729e3a454e3fdf529abd7063ceb8fa859f Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 24 Jul 2022 16:45:29 +0200 Subject: add bot detail page --- planetwars-server/src/db/users.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'planetwars-server/src/db/users.rs') diff --git a/planetwars-server/src/db/users.rs b/planetwars-server/src/db/users.rs index 1098204..ebb2268 100644 --- a/planetwars-server/src/db/users.rs +++ b/planetwars-server/src/db/users.rs @@ -57,6 +57,12 @@ pub fn create_user(credentials: &Credentials, conn: &PgConnection) -> QueryResul .get_result::(conn) } +pub fn find_user(user_id: i32, db_conn: &PgConnection) -> QueryResult { + users::table + .filter(users::id.eq(user_id)) + .first::(db_conn) +} + pub fn find_user_by_name(username: &str, db_conn: &PgConnection) -> QueryResult { users::table .filter(users::username.eq(username)) -- cgit v1.2.3