email can't be null, username removed since email can't be null

This commit is contained in:
jackiettran
2025-11-24 15:41:35 -05:00
parent 6aac929ec1
commit 532f3014df
6 changed files with 59 additions and 85 deletions

View File

@@ -43,7 +43,7 @@ router.get("/", async (req, res) => {
{
model: User,
as: "owner",
attributes: ["id", "username", "firstName", "lastName"],
attributes: ["id", "firstName", "lastName"],
},
],
limit: parseInt(limit),
@@ -180,12 +180,12 @@ router.get("/:id", optionalAuth, async (req, res) => {
{
model: User,
as: "owner",
attributes: ["id", "username", "firstName", "lastName"],
attributes: ["id", "firstName", "lastName"],
},
{
model: User,
as: "deleter",
attributes: ["id", "username", "firstName", "lastName"],
attributes: ["id", "firstName", "lastName"],
},
],
});
@@ -242,7 +242,7 @@ router.post("/", authenticateToken, requireVerifiedEmail, async (req, res) => {
{
model: User,
as: "owner",
attributes: ["id", "username", "firstName", "lastName", "email", "stripeConnectedAccountId"],
attributes: ["id", "firstName", "lastName", "email", "stripeConnectedAccountId"],
},
],
});
@@ -307,7 +307,7 @@ router.put("/:id", authenticateToken, async (req, res) => {
{
model: User,
as: "owner",
attributes: ["id", "username", "firstName", "lastName"],
attributes: ["id", "firstName", "lastName"],
},
],
});
@@ -378,7 +378,7 @@ router.delete("/admin/:id", authenticateToken, requireAdmin, async (req, res) =>
{
model: User,
as: "owner",
attributes: ["id", "username", "firstName", "lastName", "email"],
attributes: ["id", "firstName", "lastName", "email"],
},
],
});
@@ -422,12 +422,12 @@ router.delete("/admin/:id", authenticateToken, requireAdmin, async (req, res) =>
{
model: User,
as: "owner",
attributes: ["id", "username", "firstName", "lastName"],
attributes: ["id", "firstName", "lastName"],
},
{
model: User,
as: "deleter",
attributes: ["id", "username", "firstName", "lastName"],
attributes: ["id", "firstName", "lastName"],
}
],
});
@@ -492,7 +492,7 @@ router.patch("/admin/:id/restore", authenticateToken, requireAdmin, async (req,
{
model: User,
as: "owner",
attributes: ["id", "username", "firstName", "lastName"],
attributes: ["id", "firstName", "lastName"],
}
],
});