// Checking permissions
let private_message_id = data.private_message_id;
- let orig_private_message = PrivateMessage::read(context.pool(), private_message_id).await?;
+ let orig_private_message =
+ PrivateMessage::read(&mut context.pool(), private_message_id).await?;
if local_user_view.person.id != orig_private_message.recipient_id {
return Err(LemmyErrorType::CouldntUpdatePrivateMessage)?;
}
let private_message_id = data.private_message_id;
let read = data.read;
PrivateMessage::update(
- context.pool(),
+ &mut context.pool(),
private_message_id,
&PrivateMessageUpdateForm::builder().read(Some(read)).build(),
)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdatePrivateMessage)?;
- let view = PrivateMessageView::read(context.pool(), private_message_id).await?;
+ let view = PrivateMessageView::read(&mut context.pool(), private_message_id).await?;
Ok(PrivateMessageResponse {
private_message_view: view,
})