}
};
- let user_view = UserView::read(&conn, user_details_id)?;
+ let mut user_view = UserView::read(&conn, user_details_id)?;
let mut posts_query = PostQueryBuilder::create(&conn)
.sort(&sort)
let creator_user = admins.remove(creator_index);
admins.insert(0, creator_user);
+ // If its not the same user, remove the email
+ if let Some(user_id) = user_id {
+ if user_details_id != user_id {
+ user_view.email = None;
+ }
+ } else {
+ user_view.email = None;
+ }
+
// Return the jwt
Ok(GetUserDetailsResponse {
user: user_view,