From 87907ce5e7ed9f889fcbaa824ef5d891aad73f91 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Tue, 29 Jul 2025 16:11:38 -0400 Subject: [PATCH] Made delete song endpoint available --- src/callers/mod.rs | 1 + src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/callers/mod.rs b/src/callers/mod.rs index 3c6b223..cadc8ac 100644 --- a/src/callers/mod.rs +++ b/src/callers/mod.rs @@ -19,6 +19,7 @@ pub mod endpoints { pub const GETSONGS: &str = "/api/v2/song"; pub const STREAMSONG: &str = "/api/v2/song/stream/{id}"; pub const DOWNLOADSONG: &str = "/api/v2/song/download/{id}"; + pub const DELETESONG: &str = "/api/v2/song/{id}"; pub const CREATECOVERART: &str = "/api/v2/coverart"; pub const GETCOVERART: &str = "/api/v2/coverart"; pub const DOWNLOADCOVERART: &str = "/api/v2/coverart/download/{id}"; diff --git a/src/main.rs b/src/main.rs index e1c8186..48447b9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,7 +44,7 @@ async fn main() { } pub mod init { - use axum::routing::{get, patch, post}; + use axum::routing::{delete, get, patch, post}; use std::time::Duration; use tower_http::timeout::TimeoutLayer; @@ -135,6 +135,7 @@ pub mod init { crate::callers::endpoints::DOWNLOADSONG, get(crate::callers::song::endpoint::download_song), ) + .route(crate::callers::endpoints::DELETESONG, delete(crate::callers::song::endpoint::delete_song)) } pub async fn app() -> axum::Router {