mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-02 16:19:08 +00:00
check for user email in support request
This commit is contained in:
@@ -48,11 +48,20 @@ export async function sendSupportEmail(
|
||||
const { body, subject } = parsedBody.data;
|
||||
const user = req.user!;
|
||||
|
||||
if (!user?.email) {
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.BAD_REQUEST,
|
||||
"User does not have an email associated with their account"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
await sendEmail(
|
||||
SupportEmail({
|
||||
username: user.username,
|
||||
email: user.email || "Unknown",
|
||||
email: user.email,
|
||||
subject,
|
||||
body
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user