update user fetch

This commit is contained in:
2025-12-04 17:18:28 +01:00
parent 1821c38f8b
commit 5a8d1e447b
8 changed files with 4 additions and 4 deletions

View File

@@ -241,7 +241,7 @@ pub async fn get_message(
struct User {
id: i32,
username: String,
display_name: String,
//display_name: String,
}
@@ -255,7 +255,7 @@ pub async fn get_hotel_users(
};
let mut stmt = match conn.prepare(
"SELECT id, username, displayname FROM users WHERE hotel_id = ?1",
"SELECT user_id, username FROM hotel_user_link WHERE hotel_id = ?1",
) {
Ok(s) => s,
Err(e) => return (StatusCode::INTERNAL_SERVER_ERROR, format!("Prepare failed: {}", e)),
@@ -265,7 +265,7 @@ pub async fn get_hotel_users(
Ok(User {
id: row.get(0)?,
username: row.get(1)?,
display_name: row.get(2)?,
//display_name: row.get(2)?,
})
}) {
Ok(iter) => iter,

View File

@@ -20,6 +20,6 @@ pub fn chat_routes() -> Router<AppState> {
.route("/send_message", post(send_message))
.route("/get_conv", post(get_convs))
.route("/get_message", get(get_message))
.route("/hotel_users", get(get_hotel_users))
.route("/hotel_users", post(get_hotel_users))
}