From 522933304db8f32dd2957d2068e77da7d3ce4d2c Mon Sep 17 00:00:00 2001 From: FinnIckler Date: Thu, 2 May 2024 11:44:55 +0200 Subject: [PATCH] Fix Polling for V2 (#9330) * fix polling access * bonus: fix RegistrationAdministrationList --- .../RegistrationAdministrationList.jsx | 2 +- .../RegistrationsV2/api/registration/get/poll_registrations.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/webpacker/components/RegistrationsV2/RegistrationAdministration/RegistrationAdministrationList.jsx b/app/webpacker/components/RegistrationsV2/RegistrationAdministration/RegistrationAdministrationList.jsx index 5ad0b9d458..b7ed0af0dd 100644 --- a/app/webpacker/components/RegistrationsV2/RegistrationAdministration/RegistrationAdministrationList.jsx +++ b/app/webpacker/components/RegistrationsV2/RegistrationAdministration/RegistrationAdministrationList.jsx @@ -219,7 +219,6 @@ export default function RegistrationAdministrationList({ competitionInfo }) { // than putting this in the table headers which scroll out of sight const spotsRemaining = (competitionInfo.competitor_limit ?? Infinity) - accepted.length; const spotsRemainingText = i18n.t( - 'competitions.registration_v2.list.spots_remaining', 'competitions.registration_v2.list.spots_remaining', { spots: spotsRemaining }, ); @@ -265,6 +264,7 @@ export default function RegistrationAdministrationList({ competitionInfo }) { registrations={registrations} spotsRemaining={spotsRemaining} userEmailMap={userEmailMap} + competitionInfo={competitionInfo} /> diff --git a/app/webpacker/components/RegistrationsV2/api/registration/get/poll_registrations.js b/app/webpacker/components/RegistrationsV2/api/registration/get/poll_registrations.js index c64572a4d1..edbe2ff01d 100644 --- a/app/webpacker/components/RegistrationsV2/api/registration/get/poll_registrations.js +++ b/app/webpacker/components/RegistrationsV2/api/registration/get/poll_registrations.js @@ -7,7 +7,8 @@ export default async function pollRegistrations( competitionId, ) { if (process.env.NODE_ENV === 'production') { - return fetchJsonOrError(pollingRoute(userId, competitionId)); + const { data } = await fetchJsonOrError(pollingRoute(userId, competitionId)); + return data; } return pollingMock(userId, competitionId); }