summaryrefslogtreecommitdiff
path: root/src/handlers/mod.rs
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2024-11-03 18:50:29 +0100
committerWriterV2 <primary-v2@protonmail.com>2024-11-03 18:50:29 +0100
commitfa7f650562337c7f3a4fb7446e56575e26380494 (patch)
tree082643ee68f3773e6b9bfd2ed42e75d1bee79d44 /src/handlers/mod.rs
parenteb326116f4abc6b12ec81d06586d7cf08755538c (diff)
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)
Diffstat (limited to 'src/handlers/mod.rs')
-rw-r--r--src/handlers/mod.rs10
1 files changed, 6 insertions, 4 deletions
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::<DummyProduct>))
+ .route("/stories", get(build_page::<Story>))
.nest_service("/static", ServeDir::new("static"))
.layer(DefaultBodyLimit::max(1074000000))
.layer(AddExtensionLayer::new(ApiContext { pool }))