chore(form): disable no-answer option for m/apreq forms

This commit is contained in:
Steffen Jost 2023-05-10 13:12:49 +00:00
parent 1de1cdbfd4
commit 297b408e9c

View File

@ -1667,7 +1667,8 @@ mpreq :: (RenderMessage site (ValueRequired site), HandlerSite m ~ site, MonadHa
-- ^ Pseudo required
--
-- `FieldView` has `fvRequired` set to `True` and @FormSuccess Nothing@ is cast to `FormFailure`.
-- Otherwise acts exactly like `mopt`.
-- Otherwise acts exactly like `mopt` without a default value and like `mreq` with a given default value
mpreq f fs mx@(Just _) = mreq f fs mx -- This shortcut hides the invalid no-answer option if a default is provided
mpreq f fs@FieldSettings{..} mx = do
mr <- getMessageRender
(res, fv') <- mpreq' f fs $ Just <$> mx