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 }