bounswe / bounswe2022group4

6 stars 3 forks source link

Backend: Search Application - Added the sorting functionality for posts #562

Closed oguzhantok closed 1 year ago

oguzhantok commented 1 year ago

I have added the sorting functionality for posts. From now on, users can sort posts by upvote count, comment count, create date and last update date. Below is the developed endpoint:

/api/search/sort?type={input}&count{input}

for sorting according to create date, last update date, comment count and upvote count: type = create_date type = update_date type = comment_count type = upvote_count

Besides that, with the help of the count parameter users can limit the number of post in the response.