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

Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
pull/10597/head^2
nicktrn 2023-08-08 16:45:16 +01:00 committed by GitHub
parent 428e330301
commit 0d1ab6ade9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -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,