no fucking idea. was on the plane. project runs, tests pass.
This commit is contained in:
1 parent
9cc566c9d5
commit
fed675f4cb
14 files changed
+133
-40
No files matched your search
+9
-3
@@ -1,6 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use actix_web::{error, web, HttpRequest, Responder};
|
||||
use actix_web_lab::__reexports::futures_util::SinkExt;
|
||||
use clap::builder::TypedValueParser;
|
||||
use log::info;
|
||||
use minijinja::context;
|
||||
@@ -8,7 +9,7 @@ use serde::Deserialize;
|
||||
|
||||
use crate::db::users::list_users;
|
||||
use crate::events::Event;
|
||||
use crate::services::ServiceFactory;
|
||||
use crate::services::ReadOnlyServiceFactory;
|
||||
use crate::util::SQLiteConnectionFactory;
|
||||
use crate::webui::MiniJinjaRenderer;
|
||||
|
||||
@@ -17,13 +18,18 @@ pub async fn actions(tmpl_env: MiniJinjaRenderer) -> actix_web::Result<impl Resp
|
||||
tmpl_env.render("actions.html", ())
|
||||
}
|
||||
|
||||
#[actix_web::get("/accounts")]
|
||||
pub async fn accounts(tmpl_env: MiniJinjaRenderer) -> actix_web::Result<impl Responder> {
|
||||
tmpl_env.render("accounts.html", ())
|
||||
}
|
||||
|
||||
#[actix_web::get("/overview")]
|
||||
pub async fn overview(
|
||||
tmpl_env: MiniJinjaRenderer,
|
||||
conn_factory: web::Data<SQLiteConnectionFactory>,
|
||||
) -> actix_web::Result<impl Responder> {
|
||||
let conn = conn_factory.readonly().unwrap(); // todo; to proper 500
|
||||
let service_factory = ServiceFactory::new(&conn);
|
||||
let mut conn = conn_factory.readonly().unwrap(); // todo; to proper 500
|
||||
let service_factory = ReadOnlyServiceFactory::new(&mut conn);
|
||||
let user_service = service_factory.get_user_service();
|
||||
let users = user_service.list_users().unwrap();
|
||||
let ctx = context! {
|
||||
|
||||
Reference in new issue
Block a user