mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
log param parse
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/ RootR GET
|
||||
/marketplace/#PkgId MarketplaceR GET
|
||||
/ RootR GET
|
||||
/marketplace/#PkgId MarketplaceR GET
|
||||
|
||||
-- EOS API V0
|
||||
/eos/v0/latest EosVersionR GET -- get eos information
|
||||
|
||||
@@ -154,6 +154,7 @@ postPkgUploadR = do
|
||||
resourcesTemp <- getsYesod $ (</> "temp") . resourcesDir . appSettings
|
||||
createDirectoryIfMissing True resourcesTemp
|
||||
pkgId_ <- getPkgIdParam
|
||||
$logInfo $ "PARAM: " <> show pkgId_
|
||||
withTempDirectory resourcesTemp "newpkg" $ \dir -> do
|
||||
let path = dir </> "temp" <.> "s9pk"
|
||||
case pkgId_ of
|
||||
|
||||
@@ -310,8 +310,7 @@ checkAdminAuthUpload pkgId = do
|
||||
|
||||
getPkgIdParam :: MonadHandler m => m (Maybe PkgId)
|
||||
getPkgIdParam = do
|
||||
id <- lookupPostParam "id"
|
||||
case id of
|
||||
lookupPostParam "id" >>= \case
|
||||
Nothing -> pure Nothing
|
||||
Just v -> case readMaybe v of
|
||||
Nothing -> sendResponseStatus status400 ("Invalid PkgId" :: Text)
|
||||
|
||||
Reference in New Issue
Block a user