From d8a7c786ff0948a01906fdf47da04d518f20c8a2 Mon Sep 17 00:00:00 2001 From: Gabriel Weng Date: Fri, 17 Jan 2025 17:52:44 -0500 Subject: [PATCH] Call /requests/membership instead of /requests in front end --- frontend/components/ClubPage/Actions.tsx | 2 +- frontend/components/Settings/MembershipRequestsTab.tsx | 8 ++++---- frontend/pages/club/[club]/apply.tsx | 4 ++-- frontend/pages/club/[club]/index.tsx | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/components/ClubPage/Actions.tsx b/frontend/components/ClubPage/Actions.tsx index 8d0073f48..aa5903e1b 100644 --- a/frontend/components/ClubPage/Actions.tsx +++ b/frontend/components/ClubPage/Actions.tsx @@ -229,7 +229,7 @@ export const RequestMembershipButton = ({ // sanity check const resp = await doApiRequest( - `/requests/${club.code}/?format=json`, + `/requests/membership/${club.code}/?format=json`, ) if (resp.ok) { diff --git a/frontend/components/Settings/MembershipRequestsTab.tsx b/frontend/components/Settings/MembershipRequestsTab.tsx index 7148c2ee3..739a402a4 100644 --- a/frontend/components/Settings/MembershipRequestsTab.tsx +++ b/frontend/components/Settings/MembershipRequestsTab.tsx @@ -15,7 +15,7 @@ const MembershipRequestsTab = (): ReactElement => { const [requests, setRequests] = useState(null) const fetchTable = (): void => { - doApiRequest('/requests/?format=json') + doApiRequest('/requests/membership/?format=json') .then((resp) => resp.json()) .then(setRequests) } @@ -29,9 +29,9 @@ const MembershipRequestsTab = (): ReactElement => { } const withdrawRequest = (code: string): void => { - doApiRequest(`/requests/${code}/?format=json`, { method: 'DELETE' }).then( - fetchTable, - ) + doApiRequest(`/requests/membership/${code}/?format=json`, { + method: 'DELETE', + }).then(fetchTable) } return ( diff --git a/frontend/pages/club/[club]/apply.tsx b/frontend/pages/club/[club]/apply.tsx index 9b2fc8203..d8716b29d 100644 --- a/frontend/pages/club/[club]/apply.tsx +++ b/frontend/pages/club/[club]/apply.tsx @@ -50,11 +50,11 @@ const ApplyPage = ({ club, applications }: Props): ReactElement => { updateRequests={async (code: string) => { logEvent('request', code) if (updatedIsRequest) { - await doApiRequest(`/requests/${club.code}/?format=json`, { + await doApiRequest(`/requests/membership/${club.code}/?format=json`, { method: 'DELETE', }) } else { - await doApiRequest(`/requests/?format=json`, { + await doApiRequest(`/requests/membership/?format=json`, { method: 'POST', body: { club: code }, }) diff --git a/frontend/pages/club/[club]/index.tsx b/frontend/pages/club/[club]/index.tsx index b6bd88f39..ffa341ea9 100644 --- a/frontend/pages/club/[club]/index.tsx +++ b/frontend/pages/club/[club]/index.tsx @@ -115,13 +115,13 @@ const ClubPage = ({ const newClub = { ...club } logEvent(!newClub.is_request ? 'request' : 'unrequest', code) const req = !newClub.is_request - ? doApiRequest('/requests/?format=json', { + ? doApiRequest('/requests/membership/?format=json', { method: 'POST', body: { club: code, }, }) - : doApiRequest(`/requests/${code}/?format=json`, { + : doApiRequest(`/requests/membership/${code}/?format=json`, { method: 'DELETE', })