fix: filtering by post type wasn't working [BD-38] [TNL-9609] (#82)

Fixes an issue where filtering by post type wasn't working, since the filter wasn't being passed to the API.
It also simplifies the code a bit and adds tests.
This commit is contained in:
Kshitij Sobti
2022-03-14 11:06:28 +05:30
committed by GitHub
parent 1d854b45b2
commit d802e5331f
10 changed files with 310 additions and 69 deletions

View File

@@ -8,6 +8,7 @@ export const API_BASE_URL = getConfig().LMS_BASE_URL;
* @enum {string}
*/
export const ThreadType = {
ALL: 'all',
QUESTION: 'question',
DISCUSSION: 'discussion',
};
@@ -88,17 +89,6 @@ export const ThreadViewStatus = {
UNANSWERED: 'unanswered',
};
/**
* Enum for filtering user posts.
* @readonly
* @enum {string}
*/
export const MyPostsFilter = {
MY_POSTS: 'myPosts',
MY_DISCUSSIONS: 'myDiscussions',
MY_QUESTIONS: 'myQuestions',
};
/**
* Enum for filtering posts by status.
* @readonly
@@ -112,17 +102,6 @@ export const PostsStatusFilter = {
UNANSWERED: 'statusUnanswered',
};
/**
* Enum for filtering all posts.
* @readonly
* @enum {string}
*/
export const AllPostsFilter = {
ALL_POSTS: 'allPosts',
ALL_DISCUSSIONS: 'allDiscussions',
ALL_QUESTIONS: 'allQuestions',
};
/**
* Enum for filtering topics.
* @readonly