Bugfix overloaded Lists in Course
This commit is contained in:
parent
118192c168
commit
fdeec42d36
@ -1,7 +1,6 @@
|
||||
{-# LANGUAGE RecordWildCards #-}
|
||||
{-# LANGUAGE NoImplicitPrelude #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE OverloadedLists #-}
|
||||
{-# LANGUAGE MultiWayIf #-}
|
||||
{-# LANGUAGE PartialTypeSignatures #-}
|
||||
{-# LANGUAGE RecordWildCards, NamedFieldPuns, TupleSections #-}
|
||||
@ -99,7 +98,7 @@ makeCourseTable whereClause colChoices psValidator = do
|
||||
{ dbtSQLQuery
|
||||
, dbtColonnade = colChoices
|
||||
, dbtProj
|
||||
, dbtSorting =
|
||||
, dbtSorting = Map.fromList -- OverloadedLists does not work with the templates here
|
||||
[ ( "course", SortColumn $ \course -> course E.^. CourseName)
|
||||
, ( "cshort", SortColumn $ \course -> course E.^. CourseShorthand)
|
||||
, ( "term" , SortColumn $ \course -> course E.^. CourseTerm)
|
||||
@ -110,7 +109,7 @@ makeCourseTable whereClause colChoices psValidator = do
|
||||
, ( "registered", SortColumn $ course2Registered muid
|
||||
)
|
||||
]
|
||||
, dbtFilter =
|
||||
, dbtFilter = Map.fromList -- OverloadedLists does not work with the templates here
|
||||
[ ( "course", FilterColumn $ \(course :: CourseTableExpr) criterias -> if
|
||||
| Set.null criterias -> E.val True :: E.SqlExpr (E.Value Bool)
|
||||
| otherwise -> course E.^. CourseName `E.in_` E.valList (Set.toList criterias)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user