Only pre-select the service if its found

This commit is contained in:
Alex Tselegidis 2022-02-10 20:34:59 +01:00
parent 6c5917aea8
commit 0a4ea1c336

View file

@ -1546,13 +1546,15 @@ App.Utils.CalendarDefaultView = (function () {
(availableService) => (availableService) =>
Number(availableService.id) === Number($selectFilterItem.val()) Number(availableService.id) === Number($selectFilterItem.val())
); );
$appointmentsModal.find('#select-service').val(service.id).trigger('change');
if (service) {
$appointmentsModal.find('#select-service').val(service.id).trigger('change');
}
} }
// Preselect time // Preselect time
$('#start-datetime').datepicker('setDate', info.start); $('#start-datetime').datepicker('setDate', info.start);
$('#end-datetime').datepicker('setDate', info.end); $('#end-datetime').datepicker('setDate', info.end);
$('#message-box').dialog('close'); $('#message-box').dialog('close');
} }
} }