description
when selecting sort by recent in the Experiences component, the experiences are not sorted by date. instead, the api response is just set directly into state without applying any sorting.
file: Experiences.jsx
if (sortBy === "recent") {
const response = await fetch(
`${process.env.REACT_APP_API_URL || "http://localhost:8000"}/api/experiences`,
{ credentials: "include" }
);
const data = await response.json();
setExperiences(data);
setGrouped({});
}
expected behavior
experiences should be ordered by most recent first (based on their date field).
actual behavior
experiences appear in the order returned from the api, not sorted by recent.
steps to reproduce
- go to the experiences page.
- select "sort by recent" (default).
- notice that the order of experiences after scrolling completely down. nisarg did NOT add his experience before others.
description
when selecting sort by recent in the
Experiencescomponent, the experiences are not sorted by date. instead, the api response is just set directly into state without applying any sorting.file:
Experiences.jsxexpected behavior
experiences should be ordered by most recent first (based on their date field).
actual behavior
experiences appear in the order returned from the api, not sorted by recent.
steps to reproduce