remove category enum (#97)

* remove category enum

* priority inversion, 0 is always first

* set marketplace name default to something more obviously wrong.
This commit is contained in:
Keagan McClelland
2022-03-01 16:39:13 -07:00
committed by GitHub
parent 75663b65e4
commit cdadae707c
7 changed files with 9 additions and 59 deletions

View File

@@ -56,6 +56,7 @@ import Database.Esqueleto.Experimental
( Entity(entityKey, entityVal)
, SqlBackend
, (^.)
, asc
, desc
, from
, orderBy
@@ -85,7 +86,6 @@ import Lib.PkgRepository ( PkgRepo
, getManifest
)
import Lib.Types.AppIndex ( PkgId )
import Lib.Types.Category ( CategoryTitle(..) )
import Lib.Types.Emver ( Version
, VersionRange
, parseRange
@@ -138,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