This commit is contained in:
aprilthepink 2024-08-03 07:18:45 +02:00
parent 8831275097
commit 32c3dad71e

View file

@ -215,7 +215,10 @@ pub async fn lysand_url_to_user(url: Url) -> anyhow::Result<super::objects::User
if let Some(model) = opt_model { if let Some(model) = opt_model {
target = model; target = model;
} else { } else {
target = db_user_from_url(url).await?; target = ObjectId::<user::Model>::from(url)
.dereference(&data.to_request_data())
.await
.unwrap();
} }
Ok(lysand_user_from_db(target).await?) Ok(lysand_user_from_db(target).await?)
@ -235,7 +238,7 @@ pub async fn lysand_url_to_user_and_model(
if let Some(model) = opt_model { if let Some(model) = opt_model {
target = model; target = model;
} else { } else {
target = db_user_from_url(url).await?; target = db_user_from_url(url.clone()).await?;
} }
Ok((lysand_user_from_db(target.clone()).await?, target)) Ok((lysand_user_from_db(target.clone()).await?, target))