Skip to content

Commit

Permalink
Fix: Admin is not notified when a user pays from mobile app
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Dec 29, 2024
1 parent e32975f commit 411db85
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions api/src/controllers/bookingController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,9 @@ export const checkout = async (req: Request, res: Response) => {

await booking.save()

if (booking.status === movininTypes.BookingStatus.Paid && body.paymentIntentId && body.customerId) {
if (!await confirm(user, booking, false)) {
return res.sendStatus(400)
}
}

if (body.payLater) {
if (body.payLater || (booking.status === movininTypes.BookingStatus.Paid && body.paymentIntentId && body.customerId)) {
// Send confirmation email
if (!await confirm(user, booking, body.payLater)) {
if (!await confirm(user, booking, body.payLater!)) {
return res.sendStatus(400)
}

Expand Down

0 comments on commit 411db85

Please sign in to comment.