priority inversion, 0 is always first

This commit is contained in:
Keagan McClelland
2022-03-01 16:08:30 -07:00
parent ade9ffdacc
commit b666a4ee36

View File

@@ -56,6 +56,7 @@ import Database.Esqueleto.Experimental
( Entity(entityKey, entityVal)
, SqlBackend
, (^.)
, asc
, desc
, from
, orderBy
@@ -137,7 +138,7 @@ getInfoR = do
name <- getsYesod $ marketplaceName . appSettings
allCategories <- runDB $ select $ do
cats <- from $ table @Category
orderBy [desc (cats ^. CategoryPriority)]
orderBy [asc (cats ^. CategoryPriority)]
pure cats
pure $ InfoRes name $ categoryName . entityVal <$> allCategories