Skip to content

Commit

Permalink
fix: fixed Learner Post filter issue (#651)
Browse files Browse the repository at this point in the history
* fix: fixed Learner Post filter issue

* refactor: removed different  variable declaration

---------

Co-authored-by: Awais Ansari <79941147+awais-ansari@users.noreply.github.com>
  • Loading branch information
sundasnoreen12 and awais-ansari authored Jan 25, 2024
1 parent fa83570 commit 095d429
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit 095d429

Please sign in to comment.