use crate::Perform;
use actix_web::web::Data;
use lemmy_api_common::{
- blocking,
- get_local_user_view_from_jwt,
- mark_post_as_read,
post::{PostResponse, SavePost},
+ utils::{blocking, get_local_user_view_from_jwt, mark_post_as_read},
};
use lemmy_db_schema::{
source::post::{PostSaved, PostSavedForm},
traits::Saveable,
};
-use lemmy_db_views::post_view::PostView;
-use lemmy_utils::{ConnectionId, LemmyError};
+use lemmy_db_views::structs::PostView;
+use lemmy_utils::{error::LemmyError, ConnectionId};
use lemmy_websocket::LemmyContext;
#[async_trait::async_trait(?Send)]
};
if data.save {
- let save = move |conn: &'_ _| PostSaved::save(conn, &post_saved_form);
+ let save = move |conn: &mut _| PostSaved::save(conn, &post_saved_form);
blocking(context.pool(), save)
.await?
.map_err(|e| LemmyError::from_error_message(e, "couldnt_save_post"))?;
} else {
- let unsave = move |conn: &'_ _| PostSaved::unsave(conn, &post_saved_form);
+ let unsave = move |conn: &mut _| PostSaved::unsave(conn, &post_saved_form);
blocking(context.pool(), unsave)
.await?
.map_err(|e| LemmyError::from_error_message(e, "couldnt_save_post"))?;