fix(web): type server channel event field tables explicitly

tsc -b (the production build) collapses flatMap over the as-const union of
two differently shaped readonly field tuples to unknown, failing the Docker
frontend stage; a bare tsc --noEmit accepted it. Give the field entries one
explicit shared type so flatMap and channel[field.key] resolve.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Quick
2026-06-11 23:10:36 -04:00
co-authored by Claude Fable 5
parent 3d2368aed7
commit d2ccbcb1a6
@@ -41,7 +41,21 @@ import {
} from "@/hooks/queries/admin/serverNotificationChannels";
import { formatRelativeTime } from "@/lib/date";
const EVENT_SECTIONS = [
type ChannelNotifyKey =
| "notify_new_movies"
| "notify_new_episodes"
| "notify_request_submitted"
| "notify_request_approved"
| "notify_request_declined"
| "notify_request_fulfilled";
interface ChannelNotifyField {
key: ChannelNotifyKey;
label: string;
defaultValue: boolean;
}
const EVENT_SECTIONS: { label: string; fields: ChannelNotifyField[] }[] = [
{
label: "New content",
fields: [
@@ -58,12 +72,10 @@ const EVENT_SECTIONS = [
{ key: "notify_request_fulfilled", label: "Request fulfilled", defaultValue: false },
],
},
] as const;
];
const CHANNEL_NOTIFY_FIELDS = EVENT_SECTIONS.flatMap((section) => section.fields);
type ChannelNotifyKey = (typeof EVENT_SECTIONS)[number]["fields"][number]["key"];
function ChannelFormDialog({
open,
onOpenChange,