ada endpoint used

This commit is contained in:
Zynh0722 2023-11-03 05:53:27 -07:00
parent ab2c1bb677
commit 1494c4f048
3 changed files with 23 additions and 1 deletions

View file

@ -30,7 +30,7 @@ use std::net::SocketAddr;
use tower_http::services::{ServeDir, ServeFile};
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
use crate::templates::shift_reports_html;
use crate::templates::*;
include!(concat!(env!("OUT_DIR"), "/templates.rs"));
@ -77,6 +77,7 @@ async fn main() {
let app = Router::new()
.nest("/api", api::router())
.route("/", get(root))
.route("/ada", get(ada))
.route("/shift_reports", get(shift_reports))
.route("/shifts/:id/drinks", get(drinks))
.route("/shifts/:id/report", get(shift_report))
@ -141,3 +142,7 @@ async fn shift_reports(State(state): State<AppState>) -> impl IntoResponse {
render!(shift_reports_html, shifts)
}
async fn ada() -> impl IntoResponse {
render!(ada_html)
}

12
templates/ada.rs.html Normal file
View file

@ -0,0 +1,12 @@
@use super::base_html;
@use super::components::ada_list_html;
@()
@:base_html({
<div style="display: flex; flex-direction: column;">
@:ada_list_html()
</div>
})

View file

@ -0,0 +1,5 @@
@()
<div>
Oops, there should be a list here!
</div>