new column (filterable for push notificaitons status
This commit is contained in:
@ -346,7 +346,6 @@ async function filterPublishersNew(selectFields, filterDate, isExactTime = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
console.log(`getting publishers for date: ${filterDate}, isExactTime: ${isExactTime}, isForTheMonth: ${isForTheMonth}`);
|
||||
console.log`whereClause: ${JSON.stringify(whereClause)}`
|
||||
//include availabilities if flag is true
|
||||
@ -532,6 +531,7 @@ async function getAllPublishersWithStatistics(filterDate, noEndDateFilter = fals
|
||||
desiredShiftsPerMonth: true,
|
||||
lastLogin: true,
|
||||
type: true,
|
||||
pushSubscription: true,
|
||||
assignments: {
|
||||
select: {
|
||||
id: true,
|
||||
@ -575,6 +575,8 @@ async function getAllPublishersWithStatistics(filterDate, noEndDateFilter = fals
|
||||
|
||||
|
||||
allPublishers.forEach(publisher => {
|
||||
publisher.isPushActive = publisher.pushSubscription ? true : false;
|
||||
delete publisher.pushSubscription
|
||||
// Use helper functions to calculate and assign assignment counts
|
||||
publisher.currentMonthAssignments = countAssignments(publisher.assignments, monthInfo.firstMonday, monthInfo.lastSunday);
|
||||
publisher.previousMonthAssignments = countAssignments(publisher.assignments, prevMonthInfo.firstMonday, prevMonthInfo.lastSunday);
|
||||
|
Reference in New Issue
Block a user