Jeet Mehta
06/10/2022, 3:58 PMprisma.class.findMany
, by the booking.startTime
(see an example in the thread below👇):Jeet Mehta
06/10/2022, 3:59 PMconst classes = await prisma.class.findMany({
where: {
facilityId: Number(facilityId),
},
include: {
service: {
include: {
bookingGroups: {
include: {
bookings: {
include: {
participants: {
select: {
user: {
select: {
roles: true,
},
},
},
},
},
orderBy: {
startTime: "desc",
},
},
owner: true,
repeat: true,
},
},
memberships: {
include: {
membership: true,
},
},
},
},
instructors: {
include: {
user: true,
},
},
facility: {
include: {
owner: true,
},
},
},
// This is where I'm trying to orderBy
orderBy: [
{
service: {
bookingGroups: {
bookings: {
startTime: "asc",
},
},
},
},
],
});
Nurul
06/13/2022, 1:31 PM