mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-31 04:03:40 +00:00
adds minCompanion to json
This commit is contained in:
@@ -14,7 +14,10 @@ data AppVersionRes = AppVersionRes
|
|||||||
, appVersionMinCompanion :: Maybe AppVersion
|
, appVersionMinCompanion :: Maybe AppVersion
|
||||||
} deriving (Eq, Show)
|
} deriving (Eq, Show)
|
||||||
instance ToJSON AppVersionRes where
|
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
|
instance ToContent AppVersionRes where
|
||||||
toContent = toContent . toJSON
|
toContent = toContent . toJSON
|
||||||
|
|||||||
Reference in New Issue
Block a user