Keep the same provider while changing services (if possible).
This commit is contained in:
parent
03fbc518da
commit
afe06721f7
1 changed files with 6 additions and 0 deletions
|
@ -328,6 +328,8 @@ App.Components.AppointmentsModal = (function () {
|
|||
*/
|
||||
$selectService.on('change', () => {
|
||||
const serviceId = $selectService.val();
|
||||
|
||||
const providerId = $selectProvider.val();
|
||||
|
||||
$selectProvider.empty();
|
||||
|
||||
|
@ -364,6 +366,10 @@ App.Components.AppointmentsModal = (function () {
|
|||
$selectProvider.append(new Option(provider.first_name + ' ' + provider.last_name, provider.id));
|
||||
}
|
||||
});
|
||||
|
||||
if ($selectProvider.find(`option[value="${providerId}"]`).length) {
|
||||
$selectProvider.val(providerId);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue