diff --git a/apps/nextjs/src/app/admin/aila/[chatId]/view.tsx b/apps/nextjs/src/app/admin/aila/[chatId]/view.tsx index 8b7174c78..5a2c43b14 100644 --- a/apps/nextjs/src/app/admin/aila/[chatId]/view.tsx +++ b/apps/nextjs/src/app/admin/aila/[chatId]/view.tsx @@ -7,7 +7,11 @@ import { OakAccordion, OakPrimaryButton } from "@oaknational/oak-components"; import { trpc } from "@/utils/trpc"; -function ModerationListItem({ moderation }: { readonly moderation: Moderation }) { +function ModerationListItem({ + moderation, +}: { + readonly moderation: Moderation; +}) { const { id, invalidatedAt } = moderation; const [invalidated, setInvalidated] = useState(Boolean(invalidatedAt)); const invalidateModeration = trpc.admin.invalidateModeration.useMutation({ @@ -28,7 +32,7 @@ function ModerationListItem({ moderation }: { readonly moderation: Moderation }) iconName="cross" className="ml-auto" onClick={() => - invalidateModeration.mutateAsync({ moderationId: id }) + void invalidateModeration.mutateAsync({ moderationId: id }) } isLoading={invalidateModeration.isLoading} disabled={!!invalidated} @@ -41,14 +45,16 @@ function ModerationListItem({ moderation }: { readonly moderation: Moderation }) {moderation.justification}
- {moderation.categories.map((category, index) => ( - - {String(category)} - - ))} + {Array.from(new Set(moderation.categories)) + .map((c) => String(c)) + .map((category) => ( + + {category} + + ))}
diff --git a/apps/nextjs/src/components/AppComponents/FeedbackForms/ModerationFeedbackForm.tsx b/apps/nextjs/src/components/AppComponents/FeedbackForms/ModerationFeedbackForm.tsx index e5a072be0..c77be1132 100644 --- a/apps/nextjs/src/components/AppComponents/FeedbackForms/ModerationFeedbackForm.tsx +++ b/apps/nextjs/src/components/AppComponents/FeedbackForms/ModerationFeedbackForm.tsx @@ -59,7 +59,12 @@ export const ModerationFeedbackForm = ({ -
+ { + e.preventDefault(); + void onSubmit(); + }} + >