log param parse

This commit is contained in:
Lucy Cifferello
2024-04-16 19:02:24 -04:00
parent 123a9b2e83
commit 2843c29de6
3 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)