Rename functions.

This commit is contained in:
Dillon Kearns 2022-07-24 09:14:48 +02:00
parent 0c4e76c247
commit b4c26d5401
19 changed files with 24 additions and 24 deletions

View File

@ -159,7 +159,7 @@ greet : ApiRoute ApiRoute.Response
greet =
ApiRoute.succeed
(Request.oneOf
[ Request.formDataWithoutServerValidation2
[ Request.formDataWithoutServerValidation
[ Form.init
(\bar ->
{ combine =

View File

@ -194,7 +194,7 @@ data routeParams =
action : RouteParams -> Parser (DataSource (Server.Response.Response ActionData ErrorPage))
action routeParams =
Request.formDataWithoutServerValidation2 [ form ]
Request.formDataWithoutServerValidation [ form ]
|> Request.map
(\userResult ->
ActionData

View File

@ -71,7 +71,7 @@ data : RouteParams -> Request.Parser (DataSource (Response Data ErrorPage))
data routeParams =
Request.oneOf
[ MySession.withSession
(Request.formDataWithoutServerValidation2 [ form ])
(Request.formDataWithoutServerValidation [ form ])
(\nameResult session ->
(nameResult
|> Result.Extra.unpack

View File

@ -196,7 +196,7 @@ data routeParams =
action : RouteParams -> Parser (DataSource (Server.Response.Response ActionData ErrorPage))
action routeParams =
Request.formData2 [ form ]
Request.formData [ form ]
|> Request.map
(\userResultData ->
userResultData

View File

@ -71,7 +71,7 @@ data : RouteParams -> Request.Parser (DataSource (Response Data ErrorPage))
data routeParams =
Request.oneOf
[ MySession.withSession
(Request.formDataWithoutServerValidation2 [ form ])
(Request.formDataWithoutServerValidation [ form ])
(\nameResult session ->
(nameResult
|> Result.Extra.unpack

View File

@ -94,7 +94,7 @@ type alias ActionData =
data : RouteParams -> Request.Parser (DataSource (Response Data ErrorPage))
data routeParams =
Request.oneOf
[ Request.formDataWithoutServerValidation2 [ form ]
[ Request.formDataWithoutServerValidation [ form ]
|> Request.map
(\formResult ->
DataSource.succeed

View File

@ -59,7 +59,7 @@ route =
action : RouteParams -> Request.Parser (DataSource (Response ActionData ErrorPage))
action _ =
MySession.withSession
(Request.formDataWithoutServerValidation2 [ form ]
(Request.formDataWithoutServerValidation [ form ]
|> Request.map (Result.mapError (\error -> "Errors"))
|> Request.andThen Request.fromResult
)

View File

@ -536,7 +536,7 @@ route =
action : RouteParams -> Parser (DataSource (Response ActionData ErrorPage))
action routeParams =
Request.formData2 [ form ]
Request.formData [ form ]
|> Request.map
(\toDataSource ->
toDataSource

View File

@ -160,7 +160,7 @@ data routeParams =
action : RouteParams -> Parser (DataSource (Response ActionData ErrorPage))
action _ =
Request.formDataWithoutServerValidation2 [ deleteForm, createForm ]
Request.formDataWithoutServerValidation [ deleteForm, createForm ]
|> Request.map
(\actionResult ->
case actionResult of

View File

@ -91,7 +91,7 @@ data routeParams =
action : RouteParams -> Request.Parser (DataSource (Response ActionData ErrorPage))
action routeParams =
Request.formDataWithoutServerValidation2 [ postForm ]
Request.formDataWithoutServerValidation [ postForm ]
|> Request.map
(\parsedForm ->
let

View File

@ -89,7 +89,7 @@ data routeParams =
action : RouteParams -> Request.Parser (DataSource (Response ActionData ErrorPage))
action routeParams =
Request.formDataWithoutServerValidation2 [ dependentParser ]
Request.formDataWithoutServerValidation [ dependentParser ]
|> Request.map
(\parsedForm ->
let

View File

@ -192,7 +192,7 @@ oneOfParsers =
action : RouteParams -> Request.Parser (DataSource (Response ActionData ErrorPage))
action routeParams =
Request.formDataWithoutServerValidation2 oneOfParsers
Request.formDataWithoutServerValidation oneOfParsers
|> MySession.expectSessionDataOrRedirect (Session.get "userId" >> Maybe.map Uuid)
(\userId parsedAction session ->
case parsedAction of

View File

@ -51,7 +51,7 @@ route =
, action =
\_ ->
MySession.withSession
(Request.formDataWithoutServerValidation2 [ form ])
(Request.formDataWithoutServerValidation [ form ])
(\usernameResult session ->
case usernameResult of
Err _ ->

View File

@ -98,7 +98,7 @@ data routeParams =
action : RouteParams -> Request.Parser (DataSource (Response ActionData ErrorPage))
action routeParams =
Request.formDataWithoutServerValidation2 [ form ]
Request.formDataWithoutServerValidation [ form ]
|> MySession.expectSessionDataOrRedirect (Session.get "userId" >> Maybe.map Uuid)
(\userId parsed session ->
case parsed of

View File

@ -90,7 +90,7 @@ data routeParams =
action : RouteParams -> Request.Parser (DataSource (Response ActionData ErrorPage))
action routeParams =
Request.formDataWithoutServerValidation2 [ dependentParser ]
Request.formDataWithoutServerValidation [ dependentParser ]
|> Request.map
(\parsedForm ->
let

View File

@ -201,7 +201,7 @@ validateUsername rawUsername =
action : RouteParams -> Request.Parser (DataSource (Response ActionData ErrorPage))
action routeParams =
Request.formData2 [ formParser ]
Request.formData [ formParser ]
|> MySession.expectSessionDataOrRedirect (Session.get "userId" >> Maybe.map Uuid)
(\userId parsedActionData session ->
parsedActionData

View File

@ -124,7 +124,7 @@ data routeParams =
action : RouteParams -> Request.Parser (DataSource (Response ActionData ErrorPage))
action routeParams =
Request.formDataWithoutServerValidation2 [ form, deleteForm ]
Request.formDataWithoutServerValidation [ form, deleteForm ]
|> MySession.expectSessionDataOrRedirect (Session.get "userId" >> Maybe.map Uuid)
(\userId parsed session ->
case parsed of

View File

@ -1,6 +1,7 @@
module Server.Request exposing
( Parser
, succeed, fromResult, skip
, formData, formDataWithoutServerValidation
, rawFormData
, method, rawBody, allCookies, rawHeaders, queryParams
, requestTime, optionalHeader, expectContentType, expectJsonBody
@ -14,7 +15,6 @@ module Server.Request exposing
, map3, map4, map5, map6, map7, map8, map9
, Method(..), methodToString
, errorsToString, errorToString, getDecoder, ValidationError
, formData2, formDataWithoutServerValidation2
)
{-|
@ -883,7 +883,7 @@ fileField_ name =
{-| -}
formDataWithoutServerValidation2 :
formDataWithoutServerValidation :
List
(Form.Form
error
@ -891,7 +891,7 @@ formDataWithoutServerValidation2 :
data
)
-> Parser (Result { fields : List ( String, String ), errors : Dict String (List error) } combined)
formDataWithoutServerValidation2 formParsers =
formDataWithoutServerValidation formParsers =
rawFormData
|> andThen
(\rawFormData_ ->
@ -919,7 +919,7 @@ formDataWithoutServerValidation2 formParsers =
{-| -}
formData2 :
formData :
List
(Form.Form
error
@ -927,7 +927,7 @@ formData2 :
data
)
-> Parser (DataSource (Result { fields : List ( String, String ), errors : Dict String (List error) } combined))
formData2 formParsers =
formData formParsers =
rawFormData
|> andThen
(\rawFormData_ ->

View File

@ -62,7 +62,7 @@ all =
[ ( "q", "hello" ) ]
, test "tries multiple form post formats" <|
\() ->
Request.formDataWithoutServerValidation2
Request.formDataWithoutServerValidation
[ Form.init
(\bar ->
{ combine =
@ -98,7 +98,7 @@ all =
}
, test "expectFormPost with missing content-type" <|
\() ->
Request.formDataWithoutServerValidation2
Request.formDataWithoutServerValidation
[ Form.init
(\bar ->
{ combine =