don't show unpublished assignments in people's calendars
This commit is contained in:
@ -551,7 +551,8 @@ export async function filterPublishers(selectFields, searchText, filterDate, fet
|
|||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
startTime: true,
|
startTime: true,
|
||||||
endTime: true
|
endTime: true,
|
||||||
|
isPublished: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -854,7 +855,11 @@ async function getCalendarEvents(publisherId, date, availabilities = true, assig
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (assignments) {
|
if (assignments) {
|
||||||
publisher.assignments?.forEach(item => {
|
//only published shifts
|
||||||
|
|
||||||
|
publisher.assignments?.filter(
|
||||||
|
assignment => assignment.shift.isPublished
|
||||||
|
).forEach(item => {
|
||||||
result.push({
|
result.push({
|
||||||
...item,
|
...item,
|
||||||
title: common.getTimeFomatted(new Date(item.shift.startTime)) + "-" + common.getTimeFomatted(new Date(item.shift.endTime)),
|
title: common.getTimeFomatted(new Date(item.shift.startTime)) + "-" + common.getTimeFomatted(new Date(item.shift.endTime)),
|
||||||
|
Reference in New Issue
Block a user