From 194a486b7aa708c43db784933aa02a7f1ce78726 Mon Sep 17 00:00:00 2001 From: Dev Singh Date: Tue, 18 Feb 2025 00:43:25 +0000 Subject: [PATCH] disable caching on the admin portal pull for getting events --- src/ui/pages/events/ViewEvents.page.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ui/pages/events/ViewEvents.page.tsx b/src/ui/pages/events/ViewEvents.page.tsx index a44ef44e..f0c60946 100644 --- a/src/ui/pages/events/ViewEvents.page.tsx +++ b/src/ui/pages/events/ViewEvents.page.tsx @@ -97,8 +97,12 @@ export const ViewEventsPage: React.FC = () => { useEffect(() => { const getEvents = async () => { - const response = await api.get('/api/v1/events'); - const upcomingEvents = await api.get('/api/v1/events?upcomingOnly=true'); + const response = await api.get('/api/v1/events', { + headers: { 'Cache-Control': 'no-cache', Pragma: 'no-cache', Expires: 0 }, + }); + const upcomingEvents = await api.get('/api/v1/events?upcomingOnly=true', { + headers: { 'Cache-Control': 'no-cache', Pragma: 'no-cache', Expires: 0 }, + }); const upcomingEventsSet = new Set(upcomingEvents.data.map((x: EventGetResponse) => x.id)); const events = response.data; events.sort((a: EventGetResponse, b: EventGetResponse) => {