From 1786c46cab66e340ba7cd6e6482be4e40fcf9a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Gu=CC=88ldenstein?= Date: Thu, 9 May 2024 19:26:19 +0200 Subject: [PATCH] Use json data --- src/api/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/mod.rs b/src/api/mod.rs index 33c9051..e06981d 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -1,5 +1,5 @@ use crate::AppState; -use actix_web::{error, get, post, web::Data, web::Form, web::Json}; +use actix_web::{error, get, post, web::Data, web::Json}; use serde::Deserialize; use spaceapi::{State, Status}; @@ -21,7 +21,7 @@ pub async fn get_status(app_state: Data) -> Json { } #[derive(Debug, Deserialize)] -struct StateFormData { +struct StateData { open: Option, message: Option, } @@ -29,7 +29,7 @@ struct StateFormData { #[post("/status/state")] pub async fn set_state( app_state: Data, - new_state_data: Form, + new_state_data: Json, ) -> Result, SetStateError> { let mut status = match app_state.status.lock() { Err(err) => {