WorkerCalendar #270
|
@ -56,8 +56,8 @@ const onFetchAbsences = (data) => {
|
|||
|
||||
if (data.holidays) {
|
||||
data.holidays.forEach((holiday) => {
|
||||
const holidayDetail = holiday.detail && holiday.detail.name;
|
||||
const holidayType = holiday.type && holiday.type.name;
|
||||
const holidayDetail = holiday?.detail?.name;
|
||||
jsegarra marked this conversation as resolved
Outdated
|
||||
const holidayType = holiday?.type?.name;
|
||||
const holidayName = holidayDetail || holidayType;
|
||||
|
||||
addEvent(
|
||||
|
|
Loading…
Reference in New Issue
Podemos usar chaining/? hoilday?.detail
Esa parte del código la había copiado exactamente igual a
salix
, aunque me parece bien la idea del chaining y lo apliqué.Commit:
b05c28f571