mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-26 05:13:24 +03:00
Use dynamic route segments with different names by appending index.
This commit is contained in:
parent
de3a740165
commit
c27377c8f7
@ -303,13 +303,13 @@ function apiPatternToRedirectPattern(pathPattern) {
|
||||
return (
|
||||
"/" +
|
||||
pathPattern
|
||||
.map((segment) => {
|
||||
.map((segment, index) => {
|
||||
switch (segment.kind) {
|
||||
case "literal": {
|
||||
return segment.value;
|
||||
}
|
||||
case "dynamic": {
|
||||
return ":dynamic"; // TODO need to assign different names for each dynamic segment?
|
||||
return `:dynamic${index}`; // TODO need to assign different names for each dynamic segment?
|
||||
}
|
||||
default: {
|
||||
throw "Unhandled segment: " + JSON.stringify(segment);
|
||||
|
Loading…
Reference in New Issue
Block a user