Rename function.

This commit is contained in:
Dillon Kearns 2022-06-18 10:20:41 -07:00
parent 203ef32bea
commit 6bfd076baf
3 changed files with 6 additions and 7 deletions

View File

@ -210,7 +210,7 @@ view maybeUrl sharedModel model app =
pendingCreation : Result (FormParser.FieldErrors String) NewItem
pendingCreation =
form
|> FormParser.runNew app app.data
|> FormParser.parse app app.data
|> .result
|> parseIgnoreErrors
in

View File

@ -338,7 +338,7 @@ view maybeUrl sharedModel model app =
pendingCreation : Maybe NewItem
pendingCreation =
form
|> FormParser.runNew app app.data
|> FormParser.parse app app.data
|> .result
|> parseIgnoreErrors
|> Result.toMaybe

View File

@ -6,7 +6,7 @@ module Pages.FormParser exposing
, ParsedField, ok
, Context, ViewField
, renderHtml, renderStyledHtml
, runNew, runOneOfServerSide, runServerSide
, parse, runOneOfServerSide, runServerSide
, FieldDefinition(..)
)
@ -44,7 +44,7 @@ module Pages.FormParser exposing
## Running Parsers
@docs runNew, runOneOfServerSide, runServerSide
@docs parse, runOneOfServerSide, runServerSide
## Internal-Only?
@ -415,16 +415,15 @@ mergeResults parsed =
{-| -}
runNew :
parse :
AppContext app
-> data
---> CombinedParser error parsed data (Context error -> view)
-> Form error ( Maybe parsed, FieldErrors error ) data (Context error -> view)
->
{ result : ( Maybe parsed, FieldErrors error )
, view : view
}
runNew app data (Form fieldDefinitions parser _) =
parse app data (Form fieldDefinitions parser _) =
-- TODO Get transition context from `app` so you can check if the current form is being submitted
-- TODO either as a transition or a fetcher? Should be easy enough to check for the `id` on either of those?
let