mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
fixes timestamp parsing
This commit is contained in:
committed by
Aiden McClelland
parent
718d556080
commit
68a87c8c4f
3
agent/src/Lib/External/Registry.hs
vendored
3
agent/src/Lib/External/Registry.hs
vendored
@@ -36,6 +36,7 @@ import Lib.SystemPaths
|
||||
import Lib.Types.Core
|
||||
import Lib.Types.Emver
|
||||
import Lib.Types.ServerApp
|
||||
import Data.Time.ISO8601 ( parseISO8601 )
|
||||
|
||||
newtype AppManifestRes = AppManifestRes
|
||||
{ storeApps :: [StoreApp] } deriving (Eq, Show)
|
||||
@@ -135,7 +136,7 @@ parseAppData = do
|
||||
storeAppVersions <- ad .: "version-info" >>= \case
|
||||
[] -> fail "No Valid Version Info"
|
||||
(x : xs) -> pure $ x :| xs
|
||||
storeAppTimestamp <- ad .: "timestamp"
|
||||
storeAppTimestamp <- ad .: "timestamp" >>= maybe (fail "Invalid ISO8601 Timestamp") pure . parseISO8601
|
||||
pure StoreApp { .. }
|
||||
|
||||
getAppVersionForSpec :: (Has RegistryUrl sig m, Has (Error S9Error) sig m, MonadIO m)
|
||||
|
||||
@@ -36,7 +36,7 @@ instance FromJSON StoreAppVersionInfo where
|
||||
parseJSON = withObject "Store App Version Info" $ \o -> do
|
||||
storeAppVersionInfoVersion <- o .: "version"
|
||||
storeAppVersionInfoReleaseNotes <- o .: "release-notes"
|
||||
storeAppVersionInfoInstallAlert <- o .: "install-alert"
|
||||
storeAppVersionInfoInstallAlert <- o .:? "install-alert"
|
||||
pure StoreAppVersionInfo { .. }
|
||||
instance ToJSON StoreAppVersionInfo where
|
||||
toJSON StoreAppVersionInfo {..} =
|
||||
|
||||
Reference in New Issue
Block a user