fix(WP-0017/E3): Layer 3 error fixes — controllers and views

Fix compilation errors across 6 controllers and 29 views: import cleanup,
ResponseException pattern for API auth, type fixes, unused import removal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-11 23:40:31 +00:00
parent 58cad31042
commit c40f11d657
35 changed files with 96 additions and 116 deletions

View File

@@ -1,9 +1,6 @@
module Web.View.HubRoutingRules.New where
import Web.Types
import Generated.Types
import IHP.Prelude
import IHP.ViewPrelude
import Web.View.Prelude
import Web.Routes ()
data NewView = NewView
@@ -21,11 +18,14 @@ instance View NewView where
renderForm :: HubRoutingRule -> [Hub] -> Html
renderForm rule hubs = formFor rule [hsx|
{(selectField #sourceHubId hubs){ fieldLabel = "Source Hub" }}
{(selectField #targetHubId hubs){ fieldLabel = "Target Hub" }}
{(selectField #sourceHubId (hubOptions hubs)){ fieldLabel = "Source Hub" }}
{(selectField #targetHubId (hubOptions hubs)){ fieldLabel = "Target Hub" }}
{(textField #matchCategory){ helpText = "Leave blank to match any category" }}
{(textField #matchWidgetType){ helpText = "Leave blank to match any widget type" }}
{(numberField #priority){ helpText = "Higher priority rules are evaluated first" }}
{textareaField #notes}
{submitButton}
|]
hubOptions :: [Hub] -> [(Text, Id Hub)]
hubOptions = map (\h -> (h.name, h.id))