From d2ccbcb1a60c526ed08788f0863ad60e232d54e4 Mon Sep 17 00:00:00 2001 From: Quick <31828688+Quick104@users.noreply.github.com> Date: Thu, 11 Jun 2026 23:10:36 -0400 Subject: [PATCH] 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 --- .../ServerNotificationChannels.tsx | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/web/src/pages/admin-settings/ServerNotificationChannels.tsx b/web/src/pages/admin-settings/ServerNotificationChannels.tsx index 69043262..4f11e32b 100644 --- a/web/src/pages/admin-settings/ServerNotificationChannels.tsx +++ b/web/src/pages/admin-settings/ServerNotificationChannels.tsx @@ -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,