fix: fixed Learner Post filter issue (#651)
* fix: fixed Learner Post filter issue * refactor: removed different variable declaration --------- Co-authored-by: Awais Ansari <79941147+awais-ansari@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import { useParams } from 'react-router-dom';
|
||||
import { sendTrackEvent } from '@edx/frontend-platform/analytics';
|
||||
|
||||
import FilterBar from '../../../components/FilterBar';
|
||||
import { PostsStatusFilter, ThreadType } from '../../../data/constants';
|
||||
import { selectCourseCohorts } from '../../cohorts/data/selectors';
|
||||
import { fetchCourseCohorts } from '../../cohorts/data/thunks';
|
||||
import { selectUserHasModerationPrivileges, selectUserIsGroupTa } from '../../data/selectors';
|
||||
@@ -58,10 +59,16 @@ const LearnerPostFilterBar = () => {
|
||||
}
|
||||
} else if (name === 'status') {
|
||||
if (postFilter.status !== value) {
|
||||
const postType = (value === PostsStatusFilter.UNANSWERED && ThreadType.QUESTION)
|
||||
|| (value === PostsStatusFilter.UNRESPONDED && ThreadType.DISCUSSION)
|
||||
|| postFilter.postType;
|
||||
|
||||
dispatch(setPostFilter({
|
||||
...postFilter,
|
||||
postType,
|
||||
status: value,
|
||||
}));
|
||||
|
||||
filterContentEventProperties.statusFilter = value;
|
||||
}
|
||||
} else if (name === 'orderBy') {
|
||||
|
||||
Reference in New Issue
Block a user