fix: show reported label in case of reported response (#173)

* fix: show reported label in case of reported response

* fix: resolved linter issues

Co-authored-by: AhtishamShahid <ahtishamshahid@A006-00850.local>
This commit is contained in:
Ahtisham Shahid
2022-05-31 13:21:21 +05:00
committed by GitHub
parent c80c3b8143
commit 8d02ad33af
6 changed files with 15 additions and 3 deletions

View File

@@ -26,6 +26,7 @@ export const coursesApiUrl = `${apiBaseUrl}/api/discussion/v1/courses/`;
* @param {boolean} flagged If true, only threads that have been reported will be returned.
* @param {string} threadType Can be 'discussion' or 'question'.
* @param {ThreadViewStatus} view Set to "unread" on "unanswered" to filter to only those statuses.
* @param {boolean} countFlagged If true, abuseFlaggedCount will be available.
* @returns {Promise<{}>}
*/
export async function getThreads(
@@ -40,6 +41,7 @@ export async function getThreads(
author,
flagged,
threadType,
countFlagged,
} = {},
) {
const params = snakeCaseObject({
@@ -55,8 +57,8 @@ export async function getThreads(
requestedFields: 'profile_image',
author,
flagged,
countFlagged,
});
const { data } = await getAuthenticatedHttpClient().get(threadsApiUrl, { params });
return data;
}

View File

@@ -86,6 +86,7 @@ function normaliseThreads(data) {
* @param {ThreadOrdering} orderBy The results will be sorted on this basis.
* @param {ThreadFilter} filters The set of filters to apply to the thread.
* @param {number} page Page to fetch
* @param {boolean} countFlagged
* @returns {(function(*): Promise<void>)|*}
*/
export function fetchThreads(courseId, {
@@ -94,12 +95,14 @@ export function fetchThreads(courseId, {
author = null,
filters = {},
page = 1,
countFlagged,
} = {}) {
const options = {
orderBy,
topicIds,
page,
author,
countFlagged,
};
if (filters.status === PostsStatusFilter.FOLLOWING) {
options.following = true;