From fa7f650562337c7f3a4fb7446e56575e26380494 Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Sun, 3 Nov 2024 18:50:29 +0100 Subject: Feat: Finalize ability to get all products with details - Remove dummy product - Add ProductMarker method to get product id + implement - Move method to get all products out of PageBuilder into its own function in Product module - Finalize getting all products with details - Add empty implementation for Story for testing purposes (TODO: add card details) --- src/handlers/mod.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/handlers/mod.rs') diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index 34481e7..e2063eb 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -12,13 +12,15 @@ use tower_http::services::ServeDir; use admin::{admin_healthcheck, admin_middleware, generate_token, upload_story}; use frontend_builder::home; -use self::frontend_builder::{build_page, DummyProduct}; +use crate::db::story::Story; + +use self::frontend_builder::build_page; mod admin; -mod frontend_builder; +pub mod frontend_builder; #[derive(Debug, Clone)] -struct ApiContext { +pub struct ApiContext { pool: SqlitePool, } @@ -41,7 +43,7 @@ pub async fn router(pool: SqlitePool) -> Router { )) .with_state(state) .route("/", get(home)) - .route("/stories", get(build_page::)) + .route("/stories", get(build_page::)) .nest_service("/static", ServeDir::new("static")) .layer(DefaultBodyLimit::max(1074000000)) .layer(AddExtensionLayer::new(ApiContext { pool })) -- cgit v1.2.3