diff --git a/src/discussions/posts/PostsView.jsx b/src/discussions/posts/PostsView.jsx index 5f021237..691e3717 100644 --- a/src/discussions/posts/PostsView.jsx +++ b/src/discussions/posts/PostsView.jsx @@ -111,7 +111,7 @@ function PostsView({ showOwnPosts }) { filters, page: nextPage, author: showOwnPosts ? authenticatedUser.username : null, - })); + }, postsListComponent)); } }; diff --git a/src/discussions/posts/data/thunks.js b/src/discussions/posts/data/thunks.js index 917527f6..5075c50c 100644 --- a/src/discussions/posts/data/thunks.js +++ b/src/discussions/posts/data/thunks.js @@ -91,7 +91,7 @@ export function fetchThreads(courseId, { author = null, filters = {}, page = 1, -} = {}) { +} = {}, posts = []) { const options = { orderBy, topicIds, @@ -117,6 +117,7 @@ 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) {