fix initial calendar loading;

show unpublished events in calendar for ADMINS
mark unavailable publishers when they are available on another time on the same day;
This commit is contained in:
Dobromir Popov
2024-05-07 19:16:03 +03:00
parent 8d4ae3ebf5
commit 4b45342877
7 changed files with 40 additions and 17 deletions

View File

@ -614,7 +614,7 @@ function convertShiftDates(assignments) {
}
async function getCalendarEvents(publisherId, date, availabilities = true, assignments = true) {
async function getCalendarEvents(publisherId, availabilities = true, assignments = true, includeUnpublished = false) {
const result = [];
// let pubs = await filterPublishers("id,firstName,lastName,email".split(","), "", date, assignments, availabilities, date ? true : false, publisherId);
@ -682,7 +682,7 @@ async function getCalendarEvents(publisherId, date, availabilities = true, assig
//only published shifts
publisher.assignments?.filter(
assignment => assignment.shift.isPublished
assignment => assignment.shift.isPublished || includeUnpublished
).forEach(item => {
result.push({
...item,