From 0682494ee0300b50b08537bece6a885eb6f1ab34 Mon Sep 17 00:00:00 2001 From: jackiettran <41605212+jackiettran@users.noreply.github.com> Date: Thu, 1 Jan 2026 23:29:39 -0500 Subject: [PATCH] Fixed an email bug where it wasn't getting email from the db --- backend/routes/rentals.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/backend/routes/rentals.js b/backend/routes/rentals.js index 4a3c403..862c9dd 100644 --- a/backend/routes/rentals.js +++ b/backend/routes/rentals.js @@ -315,12 +315,12 @@ router.post("/", authenticateToken, requireVerifiedEmail, async (req, res) => { { model: User, as: "owner", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email"], }, { model: User, as: "renter", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email"], }, ], }); @@ -385,12 +385,12 @@ router.put("/:id/status", authenticateToken, async (req, res) => { { model: User, as: "owner", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email", "stripeConnectedAccountId"], }, { model: User, as: "renter", - attributes: ["id", "firstName", "lastName", "stripeCustomerId"], + attributes: ["id", "firstName", "lastName", "email", "stripeCustomerId"], }, ], }); @@ -459,12 +459,12 @@ router.put("/:id/status", authenticateToken, async (req, res) => { { model: User, as: "owner", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email", "stripeConnectedAccountId"], }, { model: User, as: "renter", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email"], }, ], }); @@ -563,12 +563,12 @@ router.put("/:id/status", authenticateToken, async (req, res) => { { model: User, as: "owner", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email", "stripeConnectedAccountId"], }, { model: User, as: "renter", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email"], }, ], }); @@ -726,12 +726,12 @@ router.put("/:id/decline", authenticateToken, async (req, res) => { { model: User, as: "owner", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email"], }, { model: User, as: "renter", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email"], }, ], }); @@ -1126,12 +1126,12 @@ router.post("/:id/cancel", authenticateToken, async (req, res, next) => { { model: User, as: "owner", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email"], }, { model: User, as: "renter", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email"], }, ], }); @@ -1222,12 +1222,12 @@ router.post("/:id/mark-return", authenticateToken, async (req, res, next) => { { model: User, as: "owner", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email", "stripeConnectedAccountId"], }, { model: User, as: "renter", - attributes: ["id", "firstName", "lastName"], + attributes: ["id", "firstName", "lastName", "email"], }, ], });