fix: post summaries are being repeated in the list (#105)

* fix: post summaries are being repeated in the list
This commit is contained in:
Awais Ansari
2022-03-28 15:31:42 +05:00
committed by GitHub
parent c4c001ac95
commit 3074ae807b
4 changed files with 24 additions and 38 deletions

View File

@@ -93,7 +93,7 @@ export function fetchThreads(courseId, {
author = null,
filters = {},
page = 1,
} = {}, posts = []) {
} = {}) {
const options = {
orderBy,
topicIds,
@@ -122,7 +122,6 @@ export function fetchThreads(courseId, {
try {
dispatch(fetchThreadsRequest({ courseId }));
const data = await getThreads(courseId, options);
data.results = [...posts, ...data.results];
const normalisedData = normaliseThreads(camelCaseObject(data));
dispatch(fetchThreadsSuccess({ ...normalisedData, page, author }));
} catch (error) {