rename apps endpoints to package and add header to addl endpoint

This commit is contained in:
Lucy Cifferello
2021-07-06 11:25:14 -04:00
committed by Keagan McClelland
parent 1c069ca6f8
commit 09e188e9d8
4 changed files with 15 additions and 5 deletions

View File

@@ -27,8 +27,14 @@ getVersionR = do
getVersionAppR :: Text -> Handler (Maybe AppVersionRes)
getVersionAppR appId = do
appsDir <- (</> "apps") . resourcesDir . appSettings <$> getYesod
getVersionWSpec appsDir appExt
(appsDir, appMgrDir) <- getsYesod $ ((</> "apps") . resourcesDir &&& staticBinDir) . appSettings
res <- getVersionWSpec appsDir appExt
case res of
Nothing -> pure res
Just r -> do
let appDir = (<> "/") . (</> (show $ appVersionVersion r)) . (</> toS appId) $ appsDir
addPackageHeader appMgrDir appDir appExt
pure res
where appExt = Extension (toS appId) :: Extension "s9pk"
-- @TODO update to using db record