cargo,app,auth: Update dependencies, fix breaks

This commit is contained in:
Valentin Tolmer
2024-10-16 23:43:14 +02:00
committed by nitnelave
parent 11d766b2ba
commit abfe2f3a17
7 changed files with 1237 additions and 1057 deletions

View File

@@ -40,7 +40,7 @@ pub fn date_time_input(props: &DateTimeInputProps) -> Html {
value.set(
NaiveDateTime::from_str(&string_val)
.ok()
.map(|x| DateTime::from_utc(x, Utc))
.map(|x| DateTime::from_naive_utc_and_offset(x, Utc))
)
}} />
<span class="input-group-text">{"UTC"}</span>

View File

@@ -1,6 +1,6 @@
use super::cookies::set_cookie;
use anyhow::{anyhow, Context, Result};
use gloo_net::http::{Method, Request};
use gloo_net::http::{Method, RequestBuilder};
use graphql_client::GraphQLQuery;
use lldap_auth::{login, registration, JWTClaims};
@@ -32,14 +32,16 @@ async fn call_server<Body: Serialize>(
body: RequestType<Body>,
error_message: &'static str,
) -> Result<String> {
let mut request = Request::new(url)
let request_builder = RequestBuilder::new(url)
.header("Content-Type", "application/json")
.credentials(RequestCredentials::SameOrigin);
if let RequestType::Post(b) = body {
request = request
.body(serde_json::to_string(&b)?)
.method(Method::POST);
}
let request = if let RequestType::Post(b) = body {
request_builder
.method(Method::POST)
.body(serde_json::to_string(&b)?)?
} else {
request_builder.build()?
};
let response = request.send().await?;
if response.ok() {
Ok(response.text().await?)