This commit is contained in:
Dobromir Popov
2024-03-26 01:08:57 +02:00
parent 3fcdfc1347
commit acd776e988
37 changed files with 143 additions and 107 deletions

View File

@ -68,7 +68,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
case "test":
var data = prisma.shift.findMany({
where: {
isactive: true
isActive: true
}
});
@ -110,7 +110,7 @@ async function GenerateSchedule(axios: Axios, date: string, copyFromPreviousMont
}
console.log("finding shifts for previous 3 months for statistics (between " + new Date(monthInfo.date.getFullYear(), monthInfo.date.getMonth() - 3, 1).toISOString() + " and " + monthInfo.firstDay.toISOString() + ")");
const { data: events } = await axios.get(`/api/data/cartevents?where={"isactive":{"$eq":true}}`);
const { data: events } = await axios.get(`/api/data/cartevents?where={"isActive":{"$eq":true}}`);
//// let [shiftsLastMonth, publishers] = await getShiftsAndPublishersForPreviousMonths(lastMonthInfo);
//use filterPublishers from /pages/api/data/index.ts to get publishers with stats
@ -308,7 +308,7 @@ async function GenerateSchedule(axios: Axios, date: string, copyFromPreviousMont
assignments: 'true',
availabilities: 'true',
date: common.getISODateOnly(shiftStart),
select: 'id,firstName,lastName,isactive,desiredShiftsPerMonth'
select: 'id,firstName,lastName,isActive,desiredShiftsPerMonth'
});
let allAvailablePublishers = (await axios.get(`/api/?${queryParams.toString()}`)).data;
let availablePublishers = allAvailablePublishers;
@ -616,12 +616,12 @@ async function ImportShiftsFromDocx(axios: Axios) {
// prisma.publisher.findMany({
// where: {
// isactive: true,
// isActive: true,
// },
// include: {
// availabilities: {
// where: {
// isactive: true,
// isActive: true,
// },
// },
// assignments: {