diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2025-11-21 16:26:35 +0100 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2025-11-21 16:26:35 +0100 |
| commit | 74db93c431ebc02b1dc43ec12714007d005a9704 (patch) | |
| tree | a49b7df0d4f34703222a3a3622c8c6fe4f2b3767 /src/handlers/mod.rs | |
| parent | 4c73ae9ee6e322fd8cba8d4290a5a86d85651576 (diff) | |
Update story delete endpoint to use id path to identify story
Diffstat (limited to 'src/handlers/mod.rs')
| -rw-r--r-- | src/handlers/mod.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index bb5473d..3235f24 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -3,7 +3,7 @@ use tokio::sync::Mutex; use axum::extract::DefaultBodyLimit; use axum::middleware::{self}; -use axum::routing::{get, post}; +use axum::routing::{delete, get, post}; use axum::Router; use sqlx::SqlitePool; use tower_http::add_extension::AddExtensionLayer; @@ -36,10 +36,8 @@ pub async fn router(pool: SqlitePool) -> Router { }; Router::new() - .route( - "/admin/story", - post(upload_story).delete(delete_story).get(get_stories), - ) + .route("/admin/story/:story_id", delete(delete_story)) + .route("/admin/story", post(upload_story).get(get_stories)) .route("/admin/product", get(get_products)) .route("/admin", get(admin_healthcheck)) .layer(middleware::from_fn_with_state( |
