generated from coulomb/repo-seed
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>
23 lines
727 B
Haskell
23 lines
727 B
Haskell
module Web.Controller.EnvelopeEmissionContracts where
|
|
|
|
import Web.Types
|
|
import Web.View.EnvelopeEmissionContracts.Index
|
|
import Web.View.EnvelopeEmissionContracts.Show
|
|
import Generated.Types
|
|
import IHP.Prelude
|
|
import IHP.ControllerPrelude
|
|
import Web.Routes ()
|
|
|
|
instance Controller EnvelopeEmissionContractsController where
|
|
beforeAction = ensureIsUser
|
|
|
|
action EnvelopeEmissionContractsAction = do
|
|
contracts <- query @EnvelopeEmissionContract
|
|
|> orderByDesc #createdAt
|
|
|> fetch
|
|
render IndexView { contracts }
|
|
|
|
action ShowEnvelopeEmissionContractAction { envelopeEmissionContractId } = do
|
|
contract <- fetch envelopeEmissionContractId
|
|
render ShowView { contract }
|