mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
make description optional
This commit is contained in:
@@ -6,14 +6,14 @@ import Foundation (Handler, RegistryCtx (..))
|
||||
import Handler.Util (tickleMAU)
|
||||
import Model (Category (..), EntityField (..))
|
||||
import Settings (AppSettings (..))
|
||||
import Startlude (Generic, Show, Text, pure, ($), (.), (<$>), (&&&))
|
||||
import Startlude (Generic, Show, Text, pure, ($), (.), (<$>), (&&&), Maybe)
|
||||
import Yesod (ToContent (..), ToTypedContent (..), YesodPersist (runDB), getsYesod)
|
||||
import Yesod.Core.Types (JSONResponse (..))
|
||||
|
||||
|
||||
data InfoRes = InfoRes
|
||||
{ name :: !Text
|
||||
, description:: !Text
|
||||
, description:: !(Maybe Text)
|
||||
, categories :: ![Text]
|
||||
}
|
||||
deriving (Show, Generic)
|
||||
|
||||
@@ -39,7 +39,7 @@ import Data.Aeson ( (.!=)
|
||||
)
|
||||
import Data.Aeson.Types ( parseMaybe )
|
||||
import Data.FileEmbed ( embedFile )
|
||||
import Data.Maybe ( fromJust )
|
||||
import Data.Maybe ( fromJust, Maybe )
|
||||
import Data.Version ( showVersion )
|
||||
import Data.Yaml ( decodeEither' )
|
||||
import Data.Yaml.Config ( applyEnvValue )
|
||||
@@ -85,7 +85,7 @@ data AppSettings = AppSettings
|
||||
, staticBinDir :: !FilePath
|
||||
, errorLogRoot :: !FilePath
|
||||
, marketplaceName :: !Text
|
||||
, marketplaceDescription :: !Text
|
||||
, marketplaceDescription :: !(Maybe Text)
|
||||
}
|
||||
instance Has PkgRepo AppSettings where
|
||||
extract = liftA2 PkgRepo ((</> "apps") . resourcesDir) staticBinDir
|
||||
@@ -115,7 +115,7 @@ instance FromJSON AppSettings where
|
||||
staticBinDir <- o .: "static-bin-dir"
|
||||
errorLogRoot <- o .: "error-log-root"
|
||||
marketplaceName <- o .: "marketplace-name"
|
||||
marketplaceDescription <- o .: "marketplace-description"
|
||||
marketplaceDescription <- o .:? "marketplace-description"
|
||||
|
||||
let sslKeyLocation = sslPath </> "key.pem"
|
||||
let sslCsrLocation = sslPath </> "certificate.csr"
|
||||
|
||||
Reference in New Issue
Block a user