Add additional param types.

This commit is contained in:
Dillon Kearns 2022-09-13 14:25:51 -07:00
parent d9f0a3ea08
commit 4c2e9d264a
2 changed files with 16 additions and 2 deletions

View File

@ -135,6 +135,12 @@ routeToPath routes =
RoutePattern.OptionalParam2 name ->
Elm.list []
RoutePattern.RequiredSplatParam2 ->
Elm.val "TODO"
RoutePattern.OptionalSplatParam2 ->
Elm.val "TODO"
)
|> Elm.list
)
@ -158,6 +164,12 @@ routeToPath routes =
RoutePattern.OptionalParam2 name ->
maybeToList.call (Elm.get name params)
RoutePattern.RequiredSplatParam2 ->
Elm.val "Debug.todo \"\""
RoutePattern.OptionalSplatParam2 ->
Elm.val "Debug.todo \"\""
)
|> Elm.list
)

View File

@ -303,6 +303,8 @@ type RouteParam
= StaticParam String
| DynamicParam String
| OptionalParam2 String
| RequiredSplatParam2
| OptionalSplatParam2
toVariantName : RoutePattern -> { variantName : String, params : List RouteParam }
@ -342,13 +344,13 @@ toVariantName route =
RequiredSplat ->
( "SPLAT_"
, DynamicParam "TODO"
, RequiredSplatParam2
|> Just
)
OptionalSplat ->
( "SPLAT__"
, DynamicParam "TODO"
, OptionalSplatParam2
|> Just
)
)