some fixes, first push to ovh, discord webhook

This commit is contained in:
2025-11-21 14:05:47 +01:00
parent 359f7a4ad8
commit 7356689d29
19 changed files with 1127 additions and 23 deletions

View File

@@ -22,8 +22,6 @@ pub async fn hello_rooms() -> String {
"hello from rooms".to_string()
}
pub async fn fake_db_update(
State(state): State<AppState>,
AuthClaims { user_id, hotel_id }: AuthClaims,
@@ -85,6 +83,7 @@ pub async fn clean_db_update(
}
if let Some(hotel_users) = state.ws_map.get(&hotel_id) {
let update_msg = json!({
"event-type": "room-update",
"room_id": room_id,
"status": payload.status,
"updated_by": user_id,
@@ -131,13 +130,15 @@ pub async fn get_all_rooms(
Err(e) => return (StatusCode::INTERNAL_SERVER_ERROR, format!("Prepare failed: {}", e)),
};
let room_iter = match stmt.query_map( params![],|row| {
Ok(Room {
id: row.get(0)?,
number: row.get(1)?,
status: row.get(2)?,
})
}) {
let room_iter = match stmt.query_map(
params![],|row| {
Ok(Room {
id: row.get(0)?,
number: row.get(1)?,
status: row.get(2)?,
})
}
) {
Ok(iter) => iter,
Err(e) => return (StatusCode::INTERNAL_SERVER_ERROR, format!("Query failed: {}", e)),
};