summaryrefslogtreecommitdiff
path: root/src/handlers/mod.rs
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2025-11-21 15:27:21 +0100
committerWriterV2 <primary-v2@protonmail.com>2025-11-21 15:27:21 +0100
commit4c73ae9ee6e322fd8cba8d4290a5a86d85651576 (patch)
tree574f47015d87e1d61ad33f6fd85d106a18f2e1ba /src/handlers/mod.rs
parent66d7a13414e2b185df5155a83bbdb842d3618c27 (diff)
Add admin endpoints to list stories and products
Diffstat (limited to 'src/handlers/mod.rs')
-rw-r--r--src/handlers/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
index 14ac176..bb5473d 100644
--- a/src/handlers/mod.rs
+++ b/src/handlers/mod.rs
@@ -14,6 +14,7 @@ use frontend_builder::home;
use crate::db::story::Story;
+use self::admin::{get_products, get_stories};
use self::frontend_builder::build_page;
mod admin;
@@ -35,7 +36,11 @@ pub async fn router(pool: SqlitePool) -> Router {
};
Router::new()
- .route("/admin/story", post(upload_story).delete(delete_story))
+ .route(
+ "/admin/story",
+ post(upload_story).delete(delete_story).get(get_stories),
+ )
+ .route("/admin/product", get(get_products))
.route("/admin", get(admin_healthcheck))
.layer(middleware::from_fn_with_state(
state.clone(),