fix(labels): fix exam-label delete action

This commit is contained in:
Sarah Vaupel 2022-01-24 19:33:26 +01:00
parent 42f58da44f
commit b1991eead9

View File

@ -417,7 +417,9 @@ postEOExamsR = do
addMessageI Success $ MsgExamLabelsSet (Set.size exams)
redirect $ ExamOfficeR EOExamsR
ExamRemoveLabelData -> do
runDB . forM_ (Set.toList exams) $ either delete delete
runDB . forM_ (Set.toList exams) $ either
(\eeId -> E.delete . E.from $ \extExLabel -> E.where_ (extExLabel E.^. ExamOfficeExternalExamLabelExternalExam E.==. E.val eeId))
(\eId -> E.delete . E.from $ \exLabel -> E.where_ (exLabel E.^. ExamOfficeExamLabelExam E.==. E.val eId))
addMessageI Success $ MsgExamLabelsRemoved (Set.size exams)
redirect $ ExamOfficeR EOExamsR