mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-23 14:15:33 +03:00
Rename functions.
This commit is contained in:
parent
0c4e76c247
commit
b4c26d5401
@ -159,7 +159,7 @@ greet : ApiRoute ApiRoute.Response
|
||||
greet =
|
||||
ApiRoute.succeed
|
||||
(Request.oneOf
|
||||
[ Request.formDataWithoutServerValidation2
|
||||
[ Request.formDataWithoutServerValidation
|
||||
[ Form.init
|
||||
(\bar ->
|
||||
{ combine =
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -536,7 +536,7 @@ route =
|
||||
|
||||
action : RouteParams -> Parser (DataSource (Response ActionData ErrorPage))
|
||||
action routeParams =
|
||||
Request.formData2 [ form ]
|
||||
Request.formData [ form ]
|
||||
|> Request.map
|
||||
(\toDataSource ->
|
||||
toDataSource
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -51,7 +51,7 @@ route =
|
||||
, action =
|
||||
\_ ->
|
||||
MySession.withSession
|
||||
(Request.formDataWithoutServerValidation2 [ form ])
|
||||
(Request.formDataWithoutServerValidation [ form ])
|
||||
(\usernameResult session ->
|
||||
case usernameResult of
|
||||
Err _ ->
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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_ ->
|
||||
|
@ -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 =
|
||||
|
Loading…
Reference in New Issue
Block a user