update user fetch
This commit is contained in:
BIN
db/1.sqlite-shm
Normal file
BIN
db/1.sqlite-shm
Normal file
Binary file not shown.
0
db/1.sqlite-wal
Normal file
0
db/1.sqlite-wal
Normal file
BIN
db/auth.sqlite-shm
Normal file
BIN
db/auth.sqlite-shm
Normal file
Binary file not shown.
0
db/auth.sqlite-wal
Normal file
0
db/auth.sqlite-wal
Normal file
BIN
db/auth_copy_2.sqlite-shm
Normal file
BIN
db/auth_copy_2.sqlite-shm
Normal file
Binary file not shown.
0
db/auth_copy_2.sqlite-wal
Normal file
0
db/auth_copy_2.sqlite-wal
Normal file
@@ -241,7 +241,7 @@ pub async fn get_message(
|
|||||||
struct User {
|
struct User {
|
||||||
id: i32,
|
id: i32,
|
||||||
username: String,
|
username: String,
|
||||||
display_name: String,
|
//display_name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ pub async fn get_hotel_users(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut stmt = match conn.prepare(
|
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,
|
Ok(s) => s,
|
||||||
Err(e) => return (StatusCode::INTERNAL_SERVER_ERROR, format!("Prepare failed: {}", e)),
|
Err(e) => return (StatusCode::INTERNAL_SERVER_ERROR, format!("Prepare failed: {}", e)),
|
||||||
@@ -265,7 +265,7 @@ pub async fn get_hotel_users(
|
|||||||
Ok(User {
|
Ok(User {
|
||||||
id: row.get(0)?,
|
id: row.get(0)?,
|
||||||
username: row.get(1)?,
|
username: row.get(1)?,
|
||||||
display_name: row.get(2)?,
|
//display_name: row.get(2)?,
|
||||||
})
|
})
|
||||||
}) {
|
}) {
|
||||||
Ok(iter) => iter,
|
Ok(iter) => iter,
|
||||||
|
|||||||
@@ -20,6 +20,6 @@ pub fn chat_routes() -> Router<AppState> {
|
|||||||
.route("/send_message", post(send_message))
|
.route("/send_message", post(send_message))
|
||||||
.route("/get_conv", post(get_convs))
|
.route("/get_conv", post(get_convs))
|
||||||
.route("/get_message", get(get_message))
|
.route("/get_message", get(get_message))
|
||||||
.route("/hotel_users", get(get_hotel_users))
|
.route("/hotel_users", post(get_hotel_users))
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user