mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
adds minCompanion to json
This commit is contained in:
@@ -14,7 +14,10 @@ data AppVersionRes = AppVersionRes
|
||||
, appVersionMinCompanion :: Maybe AppVersion
|
||||
} deriving (Eq, Show)
|
||||
instance ToJSON AppVersionRes where
|
||||
toJSON AppVersionRes{ appVersionVersion } = object ["version" .= appVersionVersion]
|
||||
toJSON AppVersionRes{ appVersionVersion, appVersionMinCompanion } = object $
|
||||
["version" .= appVersionVersion] <> case appVersionMinCompanion of
|
||||
Nothing -> []
|
||||
Just x -> ["minCompanion" .= x]
|
||||
|
||||
instance ToContent AppVersionRes where
|
||||
toContent = toContent . toJSON
|
||||
|
||||
Reference in New Issue
Block a user