Minor
This commit is contained in:
parent
4d0a1e8020
commit
f8bba4ac83
@ -224,7 +224,7 @@ studyFeaturesPrimaryFieldFor oldFeatures mbuid = selectField $ do
|
||||
E.where_ $ ((feature E.^. StudyFeaturesId) `E.in_` E.valList oldFeatures)
|
||||
E.||. isPrimaryActiveUserStudyFeature feature
|
||||
return (feature E.^. StudyFeaturesId, degree, field)
|
||||
mr <- liftHandler . getMessageRender
|
||||
mr <- getMessageRender
|
||||
mkOptionList . nonEmptyOptions (mr MsgNoPrimaryStudyField) <$> mapM (procOptions mr) rawOptions
|
||||
where
|
||||
isPrimaryActiveUserStudyFeature feature = case mbuid of
|
||||
@ -233,11 +233,11 @@ studyFeaturesPrimaryFieldFor oldFeatures mbuid = selectField $ do
|
||||
E.&&. feature E.^. StudyFeaturesValid E.==. E.val True
|
||||
E.&&. feature E.^. StudyFeaturesType E.==. E.val FieldPrimary
|
||||
|
||||
procOptions :: (StudyDegreeTerm -> Text) -> (E.Value StudyFeaturesId, Entity StudyDegree, Entity StudyTerms) -> Handler (Option (Maybe StudyFeaturesId))
|
||||
procOptions :: _ -> (E.Value StudyFeaturesId, Entity StudyDegree, Entity StudyTerms) -> Handler (Option (Maybe StudyFeaturesId))
|
||||
procOptions mr (E.Value sfid, Entity dgid sdegree, Entity stid sterm) = do
|
||||
cfid <- encrypt sfid
|
||||
return Option
|
||||
{ optionDisplay = mr $ StudyDegreeTerm sdegree sterm
|
||||
{ optionDisplay = mr $ SomeMessage $ StudyDegreeTerm sdegree sterm
|
||||
, optionInternalValue = Just sfid
|
||||
, optionExternalValue = toPathPiece (cfid :: CryptoID UUID StudyFeaturesId)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user