use lemmy_db_schema::{
source::{
moderator::{ModStickyPost, ModStickyPostForm},
- post::Post,
+ post::{Post, PostUpdateForm},
},
traits::Crud,
};
-use lemmy_utils::{ConnectionId, LemmyError};
+use lemmy_utils::{error::LemmyError, ConnectionId};
use lemmy_websocket::{send::send_post_ws_message, LemmyContext, UserOperation};
#[async_trait::async_trait(?Send)]
let post_id = data.post_id;
let stickied = data.stickied;
let updated_post: ApubPost = blocking(context.pool(), move |conn| {
- Post::update_stickied(conn, post_id, stickied)
+ Post::update(
+ conn,
+ post_id,
+ &PostUpdateForm::builder().stickied(Some(stickied)).build(),
+ )
})
.await??
.into();