fix: don't send request reminder for unpaid bookings (#10325)

Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
This commit is contained in:
nicktrn
2023-08-08 11:45:16 -04:00
committed by GitHub
co-authored by Joe Au-Yeung
parent 428e330301
commit 0d1ab6ade9
@@ -31,6 +31,17 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
},
// Only send reminders if the event hasn't finished
endTime: { gte: new Date() },
OR: [
// no payment required
{
payment: { none: {} },
},
// paid but awaiting approval
{
payment: { some: {} },
paid: true,
},
],
},
select: {
...bookingMinimalSelect,