mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-30 19:54:47 +00:00
add priority to order categories
This commit is contained in:
@@ -150,7 +150,10 @@ instance ToTypedContent EosRes where
|
|||||||
|
|
||||||
getCategoriesR :: Handler CategoryRes
|
getCategoriesR :: Handler CategoryRes
|
||||||
getCategoriesR = do
|
getCategoriesR = do
|
||||||
allCategories <- runDB $ select $ do from $ table @Category
|
allCategories <- runDB $ select $ do
|
||||||
|
cats <- from $ table @Category
|
||||||
|
orderBy [desc (cats ^. CategoryPriority)]
|
||||||
|
pure cats
|
||||||
pure $ CategoryRes $ categoryName . entityVal <$>allCategories
|
pure $ CategoryRes $ categoryName . entityVal <$>allCategories
|
||||||
|
|
||||||
getEosR :: Handler EosRes
|
getEosR :: Handler EosRes
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ Category
|
|||||||
parent CategoryId Maybe
|
parent CategoryId Maybe
|
||||||
description Text
|
description Text
|
||||||
UniqueName name
|
UniqueName name
|
||||||
|
priority Int default=0
|
||||||
deriving Eq
|
deriving Eq
|
||||||
deriving Show
|
deriving Show
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user