From e4a235e15acf7d3715575702bf3fdf17a79e28a3 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 28 Jun 2025 16:55:31 -0400 Subject: [PATCH] Added body serializing --- src/main.rs | 10 +++++++++- src/update_queued_song.rs | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5b2cd4d..f243265 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,7 +81,15 @@ async fn some_work( ) .await { - Ok(_response) => Ok(()), + Ok(response) => { + match response.json::().await { + Ok(_inner_response) => { + Ok(()) + } + Err(err) => Err(std::io::Error::new(std::io::ErrorKind::Other, + err.to_string())) + } + } Err(err) => Err(std::io::Error::new( std::io::ErrorKind::Other, err.to_string(), diff --git a/src/update_queued_song.rs b/src/update_queued_song.rs index 56cb753..bde96b3 100644 --- a/src/update_queued_song.rs +++ b/src/update_queued_song.rs @@ -27,4 +27,10 @@ pub async fn update_queued_song( pub mod response { use serde::{Deserialize, Serialize}; + + #[derive(Debug, Deserialize, Serialize)] + pub struct Response { + pub message: String, + pub data: Vec, + } }