Skip to content

Commit

Permalink
Merge pull request #1608 from zetkin/1591/fix-book-all-incorrect-numbers
Browse files Browse the repository at this point in the history
evaluate booked participant list before adding
  • Loading branch information
kaulfield23 authored Nov 9, 2023
2 parents 8d4509d + a54265a commit 97038bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/features/events/components/ParticipantSummaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const ParticipantSummaryCard: FC<ParticipantSummaryCardProps> = ({
numNoshowParticipants,
numRemindedParticipants,
numSignedParticipants,
bookedParticipants,
} = useEventParticipants(orgId, eventId);
const { addParticipant, setReqParticipants, sendReminders } =
useEventParticipantsMutations(orgId, eventId);
Expand Down Expand Up @@ -153,7 +154,11 @@ const ParticipantSummaryCard: FC<ParticipantSummaryCardProps> = ({
<Button
onClick={() => {
respondents?.map((r) => {
addParticipant(r.person.id);
if (
!bookedParticipants.some((p) => p.id === r.person.id)
) {
addParticipant(r.person.id);
}
});
}}
size="small"
Expand Down

0 comments on commit 97038bb

Please sign in to comment.