diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index 2a0e564b0..f4cd36c77 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -48,12 +48,12 @@ postCFavouriteR tid ssh csh = void $ do now <- liftIO getCurrentTime -- Nothing means blacklist -- should never return FavouriteCurrent - newReason <- storedFavouriteReason tid ssh csh muid >>= pure . \case + newReason <- storedFavouriteReason tid ssh csh muid <&> (\case -- Maybe (Maybe reason, blacklist) Nothing -> Just FavouriteManual Just (_reason, True) -> Just FavouriteVisited Just (Just FavouriteManual, False) -> Nothing - Just (_reason, False) -> Just FavouriteManual + Just (_reason, False) -> Just FavouriteManual) -- change stored reason in DB case newReason of (Just reason) -> do diff --git a/src/Handler/Course/Show.hs b/src/Handler/Course/Show.hs index df845f544..0b9380cee 100644 --- a/src/Handler/Course/Show.hs +++ b/src/Handler/Course/Show.hs @@ -47,7 +47,7 @@ instance Button UniWorX CourseFavouriteToggleButton where -- inspired by examAutoOccurrenceIgnoreRoomsForm courseFavouriteToggleForm :: Maybe FavouriteReason -> Form () courseFavouriteToggleForm currentReason html - = over _1 (fmap $ const ()) <$> identifyForm FIDCourseFavouriteToggle (buttonForm' [btn]) html + = over _1 void <$> identifyForm FIDCourseFavouriteToggle (buttonForm' [btn]) html where btn :: CourseFavouriteToggleButton btn = case currentReason of