make it work

This commit is contained in:
nek0 2022-07-24 23:11:47 +02:00
parent 8d47a990e7
commit e7e1305b6a
5 changed files with 24 additions and 3 deletions

View file

@ -57,10 +57,8 @@ import AppTypes
import Types
import Control
import Janitor
-- import Middleware
import Paths_mateamt (version)
import Control.Monad.Except (runExceptT)
main :: IO ()
main = do
@ -218,6 +216,9 @@ thisApi =
roleAssociationSubmit :<|>
roleAssociationDelete :<|>
getSettings :<|>
Control.updateSettings :<|>
metaGet
mateSwagger :: OA.OpenApi

View file

@ -65,6 +65,7 @@ library
Control.Journal
Control.Meta
Control.Avatar
Control.Settings
Classes.DatabaseRepresentation
Classes.ToDatabase
Classes.FromDatabase

View file

@ -138,6 +138,9 @@ roleAssociationListLink :: Link
roleAssociationSubmitLink :: Link
roleAssociationDeleteLink :: Link
settingsGetLink :: Link
settingsUpdateLnk :: Link
metaGetLink :: Link
( authGetLink :<|>
@ -180,5 +183,8 @@ metaGetLink :: Link
roleAssociationSubmitLink :<|>
roleAssociationDeleteLink :<|>
settingsGetLink :<|>
settingsUpdateLnk :<|>
metaGetLink
) = allLinks (Proxy :: Proxy MateAPI)

View file

@ -10,3 +10,4 @@ import Control.Product as C
import Control.Avatar as C
import Control.Role as C
import Control.Meta as C
import Control.Settings as C

View file

@ -1,7 +1,13 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DeriveGeneric #-}
module Types.Settings where
import Data.Aeson
import qualified Data.Text as T
import Data.OpenApi (ToSchema)
import GHC.Generics
-- internal imports
@ -11,7 +17,7 @@ data Settings = Settings
{ settingsBlockRegistration :: Bool
, settingsImprintText :: Maybe T.Text
}
deriving (Show)
deriving (Show, Generic)
instance DatabaseRepresentation Settings where
@ -24,3 +30,9 @@ instance ToDatabase Settings where
instance FromDatabase Settings where
fromDatabase (reg, imprint) = Settings reg imprint
instance FromJSON Settings
instance ToJSON Settings
instance ToSchema Settings