Prevent user making reservation without any resource chosen
@@ -105,8 +105,20 @@ export default {
this.body = ''
},
+ anyChecked: function () {
+ var anyChecked = false
+ for (var checkbox in this.resourcesCheckboxes) {
+ if (this.resourcesCheckboxes[checkbox].checked) {
+ anyChecked = true
+ break
+ }
+ }
+ return anyChecked
+ },
+
reservation: function () {
var tempReservation
+ if (this.anyChecked()) {
for (var i = 0; i < this.numberOfResources; i++) {
if (this.resourcesCheckboxes[i].checked) {
tempReservation = {
@@ -124,4 +136,5 @@ export default {
}
}
}
+}
</script>
