mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-30 03:41:57 +00:00
priority inversion, 0 is always first
This commit is contained in:
@@ -56,6 +56,7 @@ import Database.Esqueleto.Experimental
|
|||||||
( Entity(entityKey, entityVal)
|
( Entity(entityKey, entityVal)
|
||||||
, SqlBackend
|
, SqlBackend
|
||||||
, (^.)
|
, (^.)
|
||||||
|
, asc
|
||||||
, desc
|
, desc
|
||||||
, from
|
, from
|
||||||
, orderBy
|
, orderBy
|
||||||
@@ -137,7 +138,7 @@ 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 [desc (cats ^. CategoryPriority)]
|
orderBy [asc (cats ^. CategoryPriority)]
|
||||||
pure cats
|
pure cats
|
||||||
pure $ InfoRes name $ categoryName . entityVal <$> allCategories
|
pure $ InfoRes name $ categoryName . entityVal <$> allCategories
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user