Merge pull request #1243 from JanC/1231-email-validation

[1231] Validate appointment email only when set
This commit is contained in:
Alex Tselegidis 2022-05-10 13:48:50 +02:00 committed by GitHub
commit 0742b275ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -626,7 +626,7 @@ App.Components.AppointmentsModal = (function () {
} }
// Check email address. // Check email address.
if (!App.Utils.Validation.email($appointmentsModal.find('#email').val())) { if ($appointmentsModal.find('#email').val() && !App.Utils.Validation.email($appointmentsModal.find('#email').val())) {
$appointmentsModal.find('#email').addClass('is-invalid'); $appointmentsModal.find('#email').addClass('is-invalid');
throw new Error(lang('invalid_email')); throw new Error(lang('invalid_email'));
} }