bounswe / bounswe2022group4

6 stars 3 forks source link

Frontend: Order of Comments According to the Number of Upvotes, Downvotes and User Type #576

Closed mbatuhan-malazgirt closed 1 year ago

mbatuhan-malazgirt commented 1 year ago

Description:

As per the requirement, I will implement the feature to order the comments according to the number of upvotes, downvotes, and user type. The comments with more upvotes will be displayed first, followed by the comments with equal upvotes and fewer downvotes. Also, the comments with expert user type always will have top priority and are displayed as the first comments.

Steps:

1) Create a new function called sortComments that takes in an array of comments and returns a new sorted array of comments. 2) In the CommentBox component, call the sortComments function and pass in the comments array as an argument. 3) Replace the sorted array with the previous API response array in the render function.

Reviewer: @umutdenizsenerr Deadline: 27.12.2022 08.00 A.M

mbatuhan-malazgirt commented 1 year ago

The functionality is implemented. You can see the related pull request from #625

The branch is merged and now the functionality is live on our server. Therefore the issue is closed.