mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
add priority to order categories
This commit is contained in:
committed by
Keagan McClelland
parent
0d27703b33
commit
d53262e143
@@ -150,7 +150,10 @@ instance ToTypedContent EosRes where
|
||||
|
||||
getCategoriesR :: Handler CategoryRes
|
||||
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
|
||||
|
||||
getEosR :: Handler EosRes
|
||||
|
||||
@@ -64,6 +64,7 @@ Category
|
||||
parent CategoryId Maybe
|
||||
description Text
|
||||
UniqueName name
|
||||
priority Int default=0
|
||||
deriving Eq
|
||||
deriving Show
|
||||
|
||||
|
||||
Reference in New Issue
Block a user