fix schedule
This commit is contained in:
@ -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 {
|
||||||
|
Reference in New Issue
Block a user