feat: Add pagination to posts' comments

This change adds pagination to posts' comments.

When viewing a post, if there are more than one page of comments,
initially users will only see the first page of the comments, and can
load more comments by clicking "load more comments" button.

This change only affects comments to posts. For comments that are
responses to other comments the pagination has not been implemented.
This commit is contained in:
Maxim Beder
2021-09-10 13:05:22 +02:00
committed by Maxim Beder
parent 451495ce6a
commit 929c859046
11 changed files with 694 additions and 23 deletions

View File

@@ -80,6 +80,7 @@ export function fetchThreadComments(threadId, { page = 1 } = {}) {
dispatch(fetchCommentsSuccess({
...normaliseComments(camelCaseObject(data)),
page,
threadId,
}));
} catch (error) {
if (getHttpErrorStatus(error) === 403) {