Make sure maximumAttendeeCapacity is a number, not a string

Closes #1194

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-11-21 12:07:22 +01:00
parent 5a30bc2f15
commit 0452b44f21
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -279,7 +279,7 @@
:aria-minus-label="t('Decrease')"
:aria-plus-label="t('Increase')"
min="1"
v-model="eventOptions.maximumAttendeeCapacity"
v-model="maximumAttendeeCapacity"
id="number-of-places"
/>
</o-field>
@ -1292,6 +1292,15 @@ watch(isOnline, (newIsOnline) => {
}
});
const maximumAttendeeCapacity = computed({
get(): string {
return eventOptions.value.maximumAttendeeCapacity.toString();
},
set(newMaximumAttendeeCapacity: string) {
eventOptions.value.maximumAttendeeCapacity = parseInt(newMaximumAttendeeCapacity);
}
})
const dateFnsLocale = inject<Locale>("dateFnsLocale");
const firstDayOfWeek = computed((): number => {