diff --git a/src/Handler/Admin.hs b/src/Handler/Admin.hs index 2ee38518b..ad3b77383 100644 --- a/src/Handler/Admin.hs +++ b/src/Handler/Admin.hs @@ -404,7 +404,7 @@ postAdminFeaturesR = do ] dbtSorting = Map.fromList [ ("key" , SortColumn (E.^. StudyTermsKey)) - , ("isnew" , SortColumn (\studyTerm -> studyTerm E.^. StudyTermsKey `E.in_` E.valList (unStudyTermsKey <$> Set.toList newKeys))) + , ("isnew" , SortColumn (\studyTerm -> studyTerm E.^. StudyTermsKey `E.in_` E.valList (unStudyTermsKey <$> Set.toList newKeys))) -- works only once -- Remember: sorting with E.in_ by StudyTermsId instead will produce esqueleto-error "unsafeSqlBinOp: non-id/composite keys not expected here" , ("isbad" , SortColumn (\studyTerm -> studyTerm E.^. StudyTermsKey `E.in_` E.valList (unStudyTermsKey <$> Set.toList badKeys))) , ("name" , SortColumn (E.^. StudyTermsName)) @@ -416,7 +416,7 @@ postAdminFeaturesR = do } psValidator = def -- & defaultSorting [SortAscBy "name", SortAscBy "short", SortAscBy "key"] - & defaultSorting [SortDescBy "isbad", SortDescBy "isnew", SortAscBy "key"] + & defaultSorting [SortDescBy "isnew", SortDescBy "isbad", SortAscBy "key"] in dbTable psValidator DBTable{..} mkCandidateTable =