fix schedule

This commit is contained in:
Dobromir Popov
2024-06-29 11:37:42 +03:00
parent 75faedee07
commit aefc4c6ceb

View File

@ -93,10 +93,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const shifts = await prisma.shift.findMany({ const shifts = await prisma.shift.findMany({
where: { where: {
isActive: true, isActive: true,
OR: [ isPublished: true,
{ isPublished: true }, // OR: [
{ user: { role: 'admin' } } // Todo: example. fix this // { isPublished: true },
], // { user: { role: 'admin' } } // Todo: example. fix this
// ],
startTime: { startTime: {
gte: fromDate, gte: fromDate,
//lt: toDate, //lt: toDate,
@ -251,6 +252,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
); );
} }
catch (error) { catch (error) {
console.log(error);
res.status(500).json({ error: "Internal Server Error" }); res.status(500).json({ error: "Internal Server Error" });
} }
} else { } else {