forgot some

pull/1575/head
Felix Ableitner 3 years ago
parent 19001cf326
commit 08003d5e3b

@ -237,10 +237,9 @@ pub fn is_admin(local_user_view: &LocalUserView) -> Result<(), LemmyError> {
}
pub async fn get_post(post_id: PostId, pool: &DbPool) -> Result<Post, LemmyError> {
match blocking(pool, move |conn| Post::read(conn, post_id)).await? {
Ok(post) => Ok(post),
Err(_e) => Err(ApiError::err("couldnt_find_post").into()),
}
blocking(pool, move |conn| Post::read(conn, post_id))
.await?
.map_err(|_| ApiError::err("couldnt_find_post").into())
}
pub async fn get_local_user_view_from_jwt(

@ -111,16 +111,11 @@ impl PerformCrud for Register {
};
// insert the person
let inserted_person = match blocking(context.pool(), move |conn| {
let inserted_person = blocking(context.pool(), move |conn| {
Person::create(conn, &person_form)
})
.await?
{
Ok(u) => u,
Err(_) => {
return Err(ApiError::err("user_already_exists").into());
}
};
.map_err(|_| ApiError::err("user_already_exists"))?;
// Create the local user
let local_user_form = LocalUserForm {

Loading…
Cancel
Save