Skip to content

Commit

Permalink
fix(events): fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DharmapalP committed Dec 19, 2024
1 parent b896f6e commit d859f8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blocks/events/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ export default async function decorate(block) {
eventsContent.append(paginationContainer);

const defaultSortedArticle = noFeaturedEventData.sort((a, b) => new Date(b.eventDate) - new Date(a.eventDate));

noFeaturedEventData = defaultSortedArticle;
currentEvenData = defaultSortedArticle;
const queryStr = 'page=1&sortBy=desc-date';
const searchParams = new URLSearchParams(queryStr);

Expand Down Expand Up @@ -461,6 +462,7 @@ ${
const appendEvents = (articleJsonData) => {
EventsContainer.innerHTML = renderArticleCard(articleJsonData);
};
noFeaturedEventData = noFeaturedEventData.sort((a, b) => new Date(b.eventDate) - new Date(a.eventDate));
appendEvents(noFeaturedEventData);

// Render pagination pages
Expand Down

0 comments on commit d859f8a

Please sign in to comment.