Skip to content

Commit 2e5ae13

Browse files
authored
Merge pull request #58 from acm-uiuc/dsingh14/fix-caching
Disable caching on the admin portal for getting events
2 parents 48db13c + 41aa298 commit 2e5ae13

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ui/pages/events/ViewEvents.page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,12 @@ export const ViewEventsPage: React.FC = () => {
116116

117117
useEffect(() => {
118118
const getEvents = async () => {
119-
const response = await api.get('/api/v1/events');
120-
const upcomingEvents = await api.get(`/api/v1/events?upcomingOnly=true&ts=${Date.now()}`);
119+
const response = await api.get('/api/v1/events', {
120+
headers: { 'Cache-Control': 'no-cache', Pragma: 'no-cache', Expires: 0 },
121+
});
122+
const upcomingEvents = await api.get(`/api/v1/events?upcomingOnly=true&ts=${Date.now()}`, {
123+
headers: { 'Cache-Control': 'no-cache', Pragma: 'no-cache', Expires: 0 },
124+
});
121125
const upcomingEventsSet = new Set(upcomingEvents.data.map((x: EventGetResponse) => x.id));
122126
const events = response.data;
123127
events.sort((a: EventGetResponse, b: EventGetResponse) => {

0 commit comments

Comments
 (0)