Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Nov 18, 2024
2 parents e00ddfb + 677a583 commit 4dbd786
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/backend/src/routes/pdfRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,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
4 changes: 2 additions & 2 deletions packages/frontend/src/features/ReportList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ReportActions } from "./ReportActions";
import { Pagination } from "@codegouvfr/react-dsfr/Pagination";
import welcomeImage from "../assets/welcome.svg";
import { useIsDesktop } from "../hooks/useIsDesktop";
import { chunk, makeArrayOf } from "pastable";
import { chunk } from "pastable";

export type ReportWithUser = Report & { user?: { email: string; name: string } };

Expand All @@ -29,7 +29,7 @@ export const MyReports = () => {
where: { disabled: false, OR: [{ createdBy: user.id }, { redactedById: user.id }] },
take: 20,
skip: page * 20,
orderBy: { createdAt: "desc" },
orderBy: [{ meetDate: "desc" }, { createdAt: "desc" }],
include: {
user: true,
},
Expand Down

0 comments on commit 4dbd786

Please sign in to comment.