Skip to content

Commit

Permalink
fix: recipents , and ;
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Oct 21, 2024
1 parent 45cab79 commit 3e5a877
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/backend/src/routes/pdfRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export const pdfPlugin: FastifyPluginAsyncTypebox = async (fastify, _) => {
await db.report.update({ where: { id: reportId }, data: { pdf: url } });

const userMail = request.user.email;
const recipients = request.body.recipients.split(",").map((r) => r.trim());
const recipients = request.body.recipients
.replaceAll(";", ",")
.split(",")
.map((r) => r.trim());
if (!recipients.includes(userMail)) recipients.push(userMail);

const report = await db.report.findUnique({ where: { id: reportId } });
Expand Down

0 comments on commit 3e5a877

Please sign in to comment.