Skip to content

Commit

Permalink
Update lunchControllers.js
Browse files Browse the repository at this point in the history
  • Loading branch information
holabayor authored Sep 25, 2023
1 parent 5be8a80 commit 2950294
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/lunchControllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ const sendLunch = async (req, res) => {
User.findOne({ where: { id: receiver_id } }),
]);

if (!receiver) {
return createCustomError('Receiver not found', 404);
}

// Check if the sender has enough balance
if (
sender.lunch_credit_balance < totalLunchPrice ||
Expand Down

0 comments on commit 2950294

Please sign in to comment.