mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-25 12:52:27 +03:00
Extract forms list.
This commit is contained in:
parent
79b8a6589a
commit
7ac3cce9c1
@ -182,7 +182,7 @@ performAction actionInput userId =
|
||||
action : RouteParams -> Request.Parser (DataSource (Response ActionData ErrorPage))
|
||||
action routeParams =
|
||||
MySession.withSession
|
||||
(Request.formData [ newItemForm, completeItemForm, deleteItemForm, editItemForm, clearCompletedForm, toggleAllForm ])
|
||||
(Request.formData allForms)
|
||||
(\formResult session ->
|
||||
case formResult of
|
||||
Ok actionInput ->
|
||||
@ -296,7 +296,7 @@ view maybeUrl sharedModel model app =
|
||||
app.fetchers
|
||||
|> List.filterMap
|
||||
(\{ status, payload } ->
|
||||
[ editItemForm, newItemForm, completeItemForm, deleteItemForm, clearCompletedForm, toggleAllForm ]
|
||||
allForms
|
||||
|> Form.runOneOfServerSide payload.fields
|
||||
|> Tuple.first
|
||||
)
|
||||
@ -431,6 +431,11 @@ view maybeUrl sharedModel model app =
|
||||
}
|
||||
|
||||
|
||||
allForms : List (Form.HtmlForm String Action Todo Msg)
|
||||
allForms =
|
||||
[ editItemForm, newItemForm, completeItemForm, deleteItemForm, clearCompletedForm, toggleAllForm ]
|
||||
|
||||
|
||||
|
||||
-- VIEW
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user