mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
make get info a json response
This commit is contained in:
@@ -133,14 +133,14 @@ import Yesod.Core.Types ( JSONResponse(..) )
|
|||||||
import Yesod.Persist ( YesodDB )
|
import Yesod.Persist ( YesodDB )
|
||||||
import Yesod.Persist.Core ( YesodPersist(runDB) )
|
import Yesod.Persist.Core ( YesodPersist(runDB) )
|
||||||
|
|
||||||
getInfoR :: Handler InfoRes
|
getInfoR :: Handler (JSONResponse InfoRes)
|
||||||
getInfoR = do
|
getInfoR = do
|
||||||
name <- getsYesod $ marketplaceName . appSettings
|
name <- getsYesod $ marketplaceName . appSettings
|
||||||
allCategories <- runDB $ select $ do
|
allCategories <- runDB $ select $ do
|
||||||
cats <- from $ table @Category
|
cats <- from $ table @Category
|
||||||
orderBy [asc (cats ^. CategoryPriority)]
|
orderBy [asc (cats ^. CategoryPriority)]
|
||||||
pure cats
|
pure cats
|
||||||
pure $ InfoRes name $ categoryName . entityVal <$> allCategories
|
pure $ JSONResponse $ InfoRes name $ categoryName . entityVal <$> allCategories
|
||||||
|
|
||||||
getEosVersionR :: Handler (JSONResponse (Maybe EosRes))
|
getEosVersionR :: Handler (JSONResponse (Maybe EosRes))
|
||||||
getEosVersionR = do
|
getEosVersionR = do
|
||||||
|
|||||||
Reference in New Issue
Block a user