Skip to content

Commit

Permalink
fixing announcement content display in announcements table
Browse files Browse the repository at this point in the history
  • Loading branch information
DonKoko committed Nov 14, 2023
1 parent c13c8f4 commit e3c65cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/routes/_layout+/admin-dashboard+/announcements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Button } from "~/components/shared";
import { Table, Td, Th, Tr } from "~/components/table";
import { db } from "~/database";
import { requireAuthSession } from "~/modules/auth";
import { parseMarkdownToReact } from "~/utils/md.server";
import { requireAdmin } from "~/utils/roles.server";

export const loader = async ({ request }: LoaderFunctionArgs) => {
Expand All @@ -19,7 +20,12 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
},
});

return json({ announcements });
return json({
announcements: announcements.map((a) => ({
...a,
content: parseMarkdownToReact(a.content),
})),
});
};

export const action = async ({ request }: ActionFunctionArgs) => {
Expand Down

0 comments on commit e3c65cb

Please sign in to comment.