inter-hub-haskell/Web/Controller/InteractionReportingContracts.hs

22 lines
742 B
Haskell
Raw Normal View History

module Web.Controller.InteractionReportingContracts where
import Web.Types
import Web.View.InteractionReportingContracts.Index
import Web.View.InteractionReportingContracts.Show
import Generated.Types
import IHP.Prelude
import IHP.ControllerPrelude
instance Controller InteractionReportingContractsController where
beforeAction = ensureIsUser
action InteractionReportingContractsAction = do
contracts <- query @InteractionReportingContract
|> orderByDesc #createdAt
|> fetch
render IndexView { contracts }
action ShowInteractionReportingContractAction { interactionReportingContractId } = do
contract <- fetch interactionReportingContractId
render ShowView { contract }