flash is post request

This commit is contained in:
Alex Janka 2024-01-06 09:33:51 +11:00
parent b5d568a1f2
commit dc81a3cf6e
2 changed files with 2 additions and 2 deletions

View file

@ -42,7 +42,7 @@ fn App() -> Html {
.collect(); .collect();
let flash = move |_| { let flash = move |_| {
wasm_bindgen_futures::spawn_local(async move { wasm_bindgen_futures::spawn_local(async move {
match reqwasm::http::Request::get(&format!("{API_URL}/flash")) match reqwasm::http::Request::post(&format!("{API_URL}/flash"))
.send() .send()
.await .await
{ {

View file

@ -118,7 +118,7 @@ async fn charge_state(state: &State<ServerState>) -> Option<Json<shared_types::C
Some(Json(charge_state)) Some(Json(charge_state))
} }
#[get("/flash")] #[post("/flash")]
async fn flash(state: &State<ServerState>) { async fn flash(state: &State<ServerState>) {
state.flash().await; state.flash().await;
} }