]> Untitled Git - lemmy.git/blobdiff - crates/api_crud/src/post/read.rs
Moving settings and secrets to context.
[lemmy.git] / crates / api_crud / src / post / read.rs
index d651a057708cd3e50b8bbc6e5e40c3d4b6a18e5f..1cfcbaf8c5f987300196530270da255274aae211 100644 (file)
@@ -24,7 +24,8 @@ impl PerformCrud for GetPost {
     _websocket_id: Option<ConnectionId>,
   ) -> Result<GetPostResponse, LemmyError> {
     let data: &GetPost = self;
-    let local_user_view = get_local_user_view_from_jwt_opt(&data.auth, context.pool()).await?;
+    let local_user_view =
+      get_local_user_view_from_jwt_opt(&data.auth, context.pool(), context.secret()).await?;
 
     let show_bot_accounts = local_user_view
       .as_ref()
@@ -112,7 +113,8 @@ impl PerformCrud for GetPosts {
     _websocket_id: Option<ConnectionId>,
   ) -> Result<GetPostsResponse, LemmyError> {
     let data: &GetPosts = self;
-    let local_user_view = get_local_user_view_from_jwt_opt(&data.auth, context.pool()).await?;
+    let local_user_view =
+      get_local_user_view_from_jwt_opt(&data.auth, context.pool(), context.secret()).await?;
 
     let person_id = local_user_view.to_owned().map(|l| l.person.id);
 
@@ -133,7 +135,7 @@ impl PerformCrud for GetPosts {
     let community_actor_id = data
       .community_name
       .as_ref()
-      .map(|t| build_actor_id_from_shortname(EndpointType::Community, t).ok())
+      .map(|t| build_actor_id_from_shortname(EndpointType::Community, t, &context.settings()).ok())
       .unwrap_or(None);
     let saved_only = data.saved_only;