diff options
| author | Raphael Kabo <mail@raphaelkabo.com> | 2022-11-16 16:16:23 +0000 | 
|---|---|---|
| committer | Raphael Kabo <mail@raphaelkabo.com> | 2022-11-16 16:16:23 +0000 | 
| commit | e93b23db71df18480b29ed53c1b8247e7f0f83a7 (patch) | |
| tree | db74310fc79c02b4de4d65d2f013833ad5af2c44 /views | |
| parent | b2298e4b627a3d19439bfa31071106b044c569f9 (diff) | |
fix: check if event has max attendee limit
Diffstat (limited to 'views')
| -rwxr-xr-x | views/event.handlebars | 10 | 
1 files changed, 7 insertions, 3 deletions
diff --git a/views/event.handlebars b/views/event.handlebars index 8c7e2e8..ff88ba5 100755 --- a/views/event.handlebars +++ b/views/event.handlebars @@ -582,9 +582,13 @@        axios.post('/attendee/provision', {}, { params: { eventID }})          .then((response) => {            modal.find('#removalPassword').val(response.data.removalPassword); -          modal.find('#attendeeNumber') -            .attr('data-validation-allowing', `range[1;${response.data.freeSpots}]`) -            .attr('data-validation-error-msg', `Please enter a number between 1 and ${response.data.freeSpots}`); +          // If there is a limit on the number of attendees, the provisioned endpoint will return freeSpots; +          // otherwise, freeSpots will be undefined. +          if (response.data.freeSpots !== undefined) { +            modal.find('#attendeeNumber') +              .attr('data-validation-allowing', `range[1;${response.data.freeSpots}]`) +              .attr('data-validation-error-msg', `Please enter a number between 1 and ${response.data.freeSpots}`); +          }            modal.modal();           })          .catch((error) => {  | 
