Merge pull request #9 from open-craft/joaocabrita/bb4418-search_posts
[BD-38][TNL-8428] feat: Implement post search.
This commit is contained in:
@@ -60,6 +60,9 @@ export function fetchThreads(courseId, {
|
||||
if (filters.status === PostsStatusFilter.UNREAD) {
|
||||
options.view = 'unread';
|
||||
}
|
||||
if (filters.search) {
|
||||
options.textSearch = filters.search;
|
||||
}
|
||||
return async (dispatch) => {
|
||||
try {
|
||||
dispatch(fetchThreadsRequest({ courseId }));
|
||||
|
||||
@@ -13,8 +13,9 @@ function PostActionsBar({ intl }) {
|
||||
return (
|
||||
<div className="d-flex justify-content-end py-1">
|
||||
<SearchField
|
||||
placeholder={intl.formatMessage(messages.searchAllPosts)}
|
||||
onClear={() => dispatch(setSearchQuery(''))}
|
||||
onSubmit={(value) => dispatch(setSearchQuery(value))}
|
||||
placeholder={intl.formatMessage(messages.searchAllPosts)}
|
||||
/>
|
||||
<Button variant="outline-primary" className="ml-2">
|
||||
{intl.formatMessage(messages.addAPost)}
|
||||
|
||||
@@ -32,7 +32,7 @@ function TopicsView() {
|
||||
id={topicGroup.id}
|
||||
name={topicGroup.name}
|
||||
subtopics={topicGroup.children}
|
||||
key={topicGroup.name}
|
||||
key={topicGroup.id}
|
||||
filter={filter}
|
||||
/>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user