use actix_web::{get, web, HttpResponse}; use crate::templates; use crate::users::User; use crate::{Pinussy, Result}; #[get("/users")] async fn get(state: web::Data) -> Result { let users: Vec = sqlx::query_as("select * from users") .fetch_all(&state.db) .await // TODO: no unwrap .unwrap(); println!("lol"); Ok(HttpResponse::Ok().body(render!(templates::users_html, users).unwrap())) }