Skip to content

Commit

Permalink
Fix JSON serialize syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanja-4732 committed Aug 22, 2023
1 parent 4b4b36b commit 7a6cd59
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ pub async fn play_sound(url: String) -> Result<(), gloo_net::Error> {
.method(Method::GET)
.mode(RequestMode::Cors)
.cache(RequestCache::NoCache)
.body(Json(PlaySoundPayload { name: url.clone() }))?;
.body(serde_json::to_string(&PlaySoundPayload {
name: url.clone(),
})?)?;

let resp = req.send().await?;

Expand Down

0 comments on commit 7a6cd59

Please sign in to comment.