-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix: Order of params for routing has to match (#2593)
* make sure route params are sorted before comparing stringified keys * including changeset for a patch release
- Loading branch information
Tony Sullivan
authored
Feb 16, 2022
1 parent
b4dcc0f
commit 40c0e2b
Showing
4 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Dynamic route params should ignore param order when matching paths |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/astro/test/fixtures/astro-get-static-paths/src/pages/blog/[year]/[slug].astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
export async function getStaticPaths() { | ||
return [ | ||
{ params: { year: '2022', slug: 'post-1' } }, | ||
{ params: { slug: 'post-2', year: '2022' } }, | ||
] | ||
} | ||
const { year, slug } = Astro.request.params | ||
--- | ||
|
||
<html> | ||
<head> | ||
<title>{year} | {slug}</title> | ||
</head> | ||
<body></body> | ||
</html> |