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({
where: {
isActive: true,
OR: [
{ isPublished: true },
{ user: { role: 'admin' } } // Todo: example. fix this
],
isPublished: true,
// OR: [
// { isPublished: true },
// { user: { role: 'admin' } } // Todo: example. fix this
// ],
startTime: {
gte: fromDate,
//lt: toDate,
@ -251,6 +252,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
);
}
catch (error) {
console.log(error);
res.status(500).json({ error: "Internal Server Error" });
}
} else {