From fdeec42d366d761042bc065ff16a2fa79c3f54fc Mon Sep 17 00:00:00 2001 From: SJost Date: Tue, 31 Jul 2018 16:48:39 +0200 Subject: [PATCH] Bugfix overloaded Lists in Course --- src/Handler/Course.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index 3b95e77a1..080e444ec 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -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)