Skip to content

Commit

Permalink
Add auth to search (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Jul 19, 2023
1 parent 8376537 commit dc624b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/search/results/SearchFeedResultsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ import PostCommentFeed, {
} from "../../../features/feed/PostCommentFeed";
import { receivedPosts } from "../../../features/post/postSlice";
import { receivedComments } from "../../../features/comment/commentSlice";
import { jwtSelector } from "../../../features/auth/authSlice";

interface SearchPostsResultsProps {
type: "Posts" | "Comments";
}

export default function SearchPostsResults({ type }: SearchPostsResultsProps) {
const jwt = useAppSelector(jwtSelector);
const dispatch = useAppDispatch();
const { search: _encodedSearch } = useParams<{ search: string }>();
const buildGeneralBrowseLink = useBuildGeneralBrowseLink();
Expand All @@ -42,12 +44,13 @@ export default function SearchPostsResults({ type }: SearchPostsResultsProps) {
type_: type,
page,
sort,
auth: jwt,
});
dispatch(receivedPosts(response.posts));
dispatch(receivedComments(response.comments));
return [...response.posts, ...response.comments];
},
[search, client, sort, type, dispatch]
[search, client, sort, type, dispatch, jwt]
);

return (
Expand Down

0 comments on commit dc624b9

Please sign in to comment.