From 447cafa3344ab76d859c6cc72ddf83d7a62655ac Mon Sep 17 00:00:00 2001 From: CDP21 <132059856+c2d13p@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:48:14 +0100 Subject: [PATCH] Asking for events already sorted by date --- eventsAndVisitorsPage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eventsAndVisitorsPage.js b/eventsAndVisitorsPage.js index fee08a6..81822fb 100644 --- a/eventsAndVisitorsPage.js +++ b/eventsAndVisitorsPage.js @@ -104,8 +104,8 @@ async function loadEvents() { try { // let res = await fetch('https://www.dm.unipi.it/wp-json/wp/v2/unipievents?per_page=50'); - let res_sem = await (await fetch('https://manage.dm.unipi.it/api/v0/public/seminars?from=now')).json() - let res_con = await (await fetch('https://manage.dm.unipi.it/api/v0/public/conferences?from=now')).json() + let res_sem = await (await fetch('https://manage.dm.unipi.it/api/v0/public/seminars?from=now&_sort=startDatetime')).json() + let res_con = await (await fetch('https://manage.dm.unipi.it/api/v0/public/conferences?from=now&_sort=startDate')).json() const res_sem_aug = res_sem.data.map((x) => { return { ...x, type: 'seminar' }