Fixed an email bug where it wasn't getting email from the db

This commit is contained in:
jackiettran
2026-01-01 23:29:39 -05:00
parent fe38ef430a
commit 0682494ee0

View File

@@ -315,12 +315,12 @@ router.post("/", authenticateToken, requireVerifiedEmail, async (req, res) => {
{ {
model: User, model: User,
as: "owner", as: "owner",
attributes: ["id", "firstName", "lastName"], attributes: ["id", "firstName", "lastName", "email"],
}, },
{ {
model: User, model: User,
as: "renter", 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, model: User,
as: "owner", as: "owner",
attributes: ["id", "firstName", "lastName"], attributes: ["id", "firstName", "lastName", "email", "stripeConnectedAccountId"],
}, },
{ {
model: User, model: User,
as: "renter", 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, model: User,
as: "owner", as: "owner",
attributes: ["id", "firstName", "lastName"], attributes: ["id", "firstName", "lastName", "email", "stripeConnectedAccountId"],
}, },
{ {
model: User, model: User,
as: "renter", 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, model: User,
as: "owner", as: "owner",
attributes: ["id", "firstName", "lastName"], attributes: ["id", "firstName", "lastName", "email", "stripeConnectedAccountId"],
}, },
{ {
model: User, model: User,
as: "renter", 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, model: User,
as: "owner", as: "owner",
attributes: ["id", "firstName", "lastName"], attributes: ["id", "firstName", "lastName", "email"],
}, },
{ {
model: User, model: User,
as: "renter", 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, model: User,
as: "owner", as: "owner",
attributes: ["id", "firstName", "lastName"], attributes: ["id", "firstName", "lastName", "email"],
}, },
{ {
model: User, model: User,
as: "renter", 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, model: User,
as: "owner", as: "owner",
attributes: ["id", "firstName", "lastName"], attributes: ["id", "firstName", "lastName", "email", "stripeConnectedAccountId"],
}, },
{ {
model: User, model: User,
as: "renter", as: "renter",
attributes: ["id", "firstName", "lastName"], attributes: ["id", "firstName", "lastName", "email"],
}, },
], ],
}); });