blob: eb08ade757f999d0fc2b5a47ee9dee30fe198fd0 (
plain) (
tree)
|
|
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<Pinussy>) -> Result<HttpResponse> {
let users: Vec<User> = state.db.users().read_all().await?;
Ok(HttpResponse::Ok().body(render!(templates::users_html, users).unwrap()))
}
|