- let res = Post::update(context.pool(), post_id, &post_form).await;
- if let Err(e) = res {
- let err_type = if e.to_string() == "value too long for type character varying(200)" {
- "post_title_too_long"
- } else {
- "couldnt_update_post"
- };
-
- return Err(LemmyError::from_error_message(e, err_type));
- }
-
- context
- .send_post_ws_message(
- &UserOperationCrud::EditPost,
- data.post_id,
- websocket_id,
- Some(local_user_view.person.id),
- )