Remove warnings

This commit is contained in:
Filip Gralinski 2021-02-05 11:31:03 +01:00
parent 3729eaea50
commit 301343e3a2

View File

@ -816,23 +816,23 @@ getAddUserR = do
Nothing -> return $ Bool False Nothing -> return $ Bool False
getChallengeAllSubmissionsJsonR :: Text -> Handler Value getChallengeAllSubmissionsJsonR :: Text -> Handler Value
getChallengeAllSubmissionsJsonR name = do getChallengeAllSubmissionsJsonR challengeName = do
v <- fetchAllSubmissionsView name v <- fetchAllSubmissionsView challengeName
return $ toJSON v return $ toJSON v
getChallengeMySubmissionsJsonR :: Text -> Handler Value getChallengeMySubmissionsJsonR :: Text -> Handler Value
getChallengeMySubmissionsJsonR name = do getChallengeMySubmissionsJsonR challengeName = do
v <- fetchMySubmissionsView name v <- fetchMySubmissionsView challengeName
return $ toJSON v return $ toJSON v
fetchAllSubmissionsView :: Text -> Handler SubmissionsView fetchAllSubmissionsView :: Text -> Handler SubmissionsView
fetchAllSubmissionsView name = do fetchAllSubmissionsView challengeName = do
fetchChallengeSubmissionsView (const True) name fetchChallengeSubmissionsView (const True) challengeName
fetchMySubmissionsView :: Text -> Handler SubmissionsView fetchMySubmissionsView :: Text -> Handler SubmissionsView
fetchMySubmissionsView name = do fetchMySubmissionsView challengeName = do
Entity userId _ <- requireAuthPossiblyByToken Entity userId _ <- requireAuthPossiblyByToken
fetchChallengeSubmissionsView (\(Entity _ submission) -> (submissionSubmitter submission == userId)) name fetchChallengeSubmissionsView (\(Entity _ submission) -> (submissionSubmitter submission == userId)) challengeName
convertTagInfoToView :: (Entity Import.Tag, Entity SubmissionTag) -> TagView convertTagInfoToView :: (Entity Import.Tag, Entity SubmissionTag) -> TagView
convertTagInfoToView tagInfo = convertTagInfoToView tagInfo =