Skip to content

Commit

Permalink
Fix trigger reset API call
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasPius committed Apr 4, 2024
1 parent 0175107 commit 2ca5d2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/api/reset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ fn get_reset_options(server_number: ServerId) -> UnauthenticatedRequest<Single<R
fn trigger_reset(
server_number: ServerId,
reset: Reset,
) -> Result<UnauthenticatedRequest<ExecutedReset>, serde_html_form::ser::Error> {
) -> Result<UnauthenticatedRequest<Single<ExecuteReset>>, serde_html_form::ser::Error> {
UnauthenticatedRequest::from(&format!(
"https://robot-ws.your-server.de/reset/{server_number}"
))
.with_method("POST")
.with_body(ExecutedReset { reset })
.with_body(ExecuteReset { reset })
}

impl AsyncRobot {
Expand Down Expand Up @@ -85,12 +85,12 @@ impl AsyncRobot {
server_number: ServerId,
reset: Reset,
) -> Result<Reset, Error> {
Ok(self.go(trigger_reset(server_number, reset)?).await?.reset)
Ok(self.go(trigger_reset(server_number, reset)?).await?.0.reset)
}
}

#[derive(Serialize, Deserialize)]
struct ExecutedReset {
struct ExecuteReset {
#[serde(rename = "type")]
reset: Reset,
}
Expand Down

0 comments on commit 2ca5d2d

Please sign in to comment.