diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2024-11-07 18:35:27 +0100 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2024-11-07 18:35:27 +0100 |
| commit | 680867b4bb5e2708f02fc3f8c21c3563975c44c7 (patch) | |
| tree | 0e90e583f1696d3c7c66484a5f8dbd919c75245d /src/handlers/mod.rs | |
| parent | 99fc959383d5b7b26d8e80f6257adf8b98989f41 (diff) | |
Feat: Add admin API route to delete story by product id
Diffstat (limited to 'src/handlers/mod.rs')
| -rw-r--r-- | src/handlers/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index e2063eb..14ac176 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -9,7 +9,7 @@ use sqlx::SqlitePool; use tower_http::add_extension::AddExtensionLayer; use tower_http::services::ServeDir; -use admin::{admin_healthcheck, admin_middleware, generate_token, upload_story}; +use admin::{admin_healthcheck, admin_middleware, delete_story, generate_token, upload_story}; use frontend_builder::home; use crate::db::story::Story; @@ -35,7 +35,7 @@ pub async fn router(pool: SqlitePool) -> Router { }; Router::new() - .route("/admin/story", post(upload_story)) + .route("/admin/story", post(upload_story).delete(delete_story)) .route("/admin", get(admin_healthcheck)) .layer(middleware::from_fn_with_state( state.clone(), |
