Remove redundant function.

This commit is contained in:
Dillon Kearns 2022-08-03 09:55:13 +02:00
parent 32c451fe82
commit 6d63a11d4f
2 changed files with 3 additions and 39 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
module Server.Request exposing
( Parser
, succeed, fromResult, skip
, formData, formDataWithoutServerValidation, formDataWithServerValidation
, formData, formDataWithServerValidation
, rawFormData
, method, rawBody, allCookies, rawHeaders, queryParams
, requestTime, optionalHeader, expectContentType, expectJsonBody
@ -26,7 +26,7 @@ module Server.Request exposing
## Forms
@docs formData, formDataWithoutServerValidation, formDataWithServerValidation
@docs formData, formDataWithServerValidation
@docs rawFormData
@ -883,42 +883,6 @@ fileField_ name =
|> Internal.Request.Parser
{-| -}
formDataWithoutServerValidation :
List
(Form.Form
error
{ all | combine : Validation error combined kind constraints }
data
)
-> Parser (Result { fields : List ( String, String ), errors : Dict String (List error) } combined)
formDataWithoutServerValidation formParsers =
rawFormData
|> andThen
(\rawFormData_ ->
let
( maybeDecoded, errors ) =
Form.runOneOfServerSide
rawFormData_
formParsers
in
case ( maybeDecoded, errors |> Dict.toList |> List.filter (\( _, value ) -> value |> List.isEmpty |> not) |> List.NonEmpty.fromList ) of
( Just decoded, Nothing ) ->
succeed (Ok decoded)
( _, maybeErrors ) ->
Err
{ fields = rawFormData_
, errors =
maybeErrors
|> Maybe.map List.NonEmpty.toList
|> Maybe.withDefault []
|> Dict.fromList
}
|> succeed
)
{-| -}
formDataWithServerValidation :
List