Use no-value placeholders in the appointments modal

This commit is contained in:
Alex Tselegidis 2022-05-27 09:29:19 +02:00
parent d7e5817484
commit 8a5e4a67b0

View file

@ -225,7 +225,7 @@ App.Components.AppointmentsModal = (function () {
vars('customers').forEach((customer) => { vars('customers').forEach((customer) => {
$('<div/>', { $('<div/>', {
'data-id': customer.id, 'data-id': customer.id,
'text': customer.first_name + ' ' + customer.last_name 'text': (customer.first_name || '[No First Name]') + ' ' + (customer.last_name || '[No Last Name]')
}).appendTo($existingCustomersList); }).appendTo($existingCustomersList);
}); });
} else { } else {
@ -286,7 +286,7 @@ App.Components.AppointmentsModal = (function () {
response.forEach((customer) => { response.forEach((customer) => {
$('<div/>', { $('<div/>', {
'data-id': customer.id, 'data-id': customer.id,
'text': customer.first_name + ' ' + customer.last_name 'text': (customer.first_name || '[No First Name]') + ' ' + (customer.last_name || '[No Last Name]')
}).appendTo($existingCustomersList); }).appendTo($existingCustomersList);
// Verify if this customer is on the old customer list. // Verify if this customer is on the old customer list.
@ -317,7 +317,7 @@ App.Components.AppointmentsModal = (function () {
) { ) {
$('<div/>', { $('<div/>', {
'data-id': customer.id, 'data-id': customer.id,
'text': customer.first_name + ' ' + customer.last_name 'text': (customer.first_name || '[No First Name]') + ' ' + (customer.last_name || '[No Last Name]')
}).appendTo($existingCustomersList); }).appendTo($existingCustomersList);
} }
}); });