use lemmy_db_schema::{
source::{
moderator::{ModAdd, ModAddForm},
- person::Person,
+ person::{Person, PersonUpdateForm},
},
traits::Crud,
};
use lemmy_db_views_actor::structs::PersonViewSafe;
-use lemmy_utils::{ConnectionId, LemmyError};
+use lemmy_utils::{error::LemmyError, ConnectionId};
use lemmy_websocket::{messages::SendAllMessage, LemmyContext, UserOperation};
#[async_trait::async_trait(?Send)]
let added = data.added;
let added_person_id = data.person_id;
let added_admin = blocking(context.pool(), move |conn| {
- Person::add_admin(conn, added_person_id, added)
+ Person::update(
+ conn,
+ added_person_id,
+ &PersonUpdateForm::builder().admin(Some(added)).build(),
+ )
})
.await?
.map_err(|e| LemmyError::from_error_message(e, "couldnt_update_user"))?;