wanderlust: [BUG] Issue in Latest Post Section

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Array of 16 post are fetching from this api “https://wanderlust-backend-bay.vercel.app/api/posts/latest” for latest section, out of these 16 only first 5 posts are rendering.This array is not sorted correctly, this is because of issue in the database I guess. Most of the sample posts are taking system date and time as a time of Post, may be this is causing the issue. In local api for this latest post also same issue newly created posts are sorted correctly in the response, but the sample posts which are in db initially are taking system date and time as timeOfPost they are not sorted in the response of api. This is same with the api “https://wanderlust-backend-bay.vercel.app/api/posts/latest

Screenshot 2023-12-27 at 10 21 24 PM

Expected Behavior

Response from the api “https://wanderlust-backend-bay.vercel.app/api/posts/latest” should be sorted correctly by the date and time of Post.

Reproduction URL

https://github.com/Raghunandan-29

Reproduction steps

1. Go to 'https://wanderlust-beta.vercel.app/'
2. Checkout 'Latest Posts'
3. Scroll down to 'All Posts'
4. There are many Posts with latest date and time than the posts rendered in the Latest Posts section.
5. See error

For Api:
1. Go to 'https://wanderlust-backend-bay.vercel.app/api/posts/latest'
2. Check the response timeOfPost (they are not sorted correctly)
3. The post which are added by create post are sorted corrctly but the sample post in DB are not sorted.

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

Browsers

Chrome

OS

Mac

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@krishnaacharyaa can I take this issue ?