Skip to content

Commit

Permalink
Fix duplicate paths
Browse files Browse the repository at this point in the history
  • Loading branch information
besated committed Sep 18, 2024
1 parent 19ec2a2 commit 7626702
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion components/APIEndpoint/APIEndpoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const APIEndpoint = ({ endpoint }: { endpoint: Endpoint }) => {
const parts = path
.split('/')
.filter((part: string) => !part.startsWith('{') && part !== '')
.map((part: string) => part.replace('-', '').toLowerCase());
.map((part: string) => part.toLowerCase());

const orgName = parts[0];
const moduleName = parts[1];
Expand Down
3 changes: 2 additions & 1 deletion components/APIEndpointRoute/APIEndpointRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export const getStaticPaths = () => {
}
return [fullRoute, ...parentRoutes];
});
const uniquePaths = Array.from(new Set(paths.map((path) => JSON.stringify(path)))).map((path) => JSON.parse(path));
return {
paths: paths,
paths: uniquePaths,
fallback: false
};
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"next-seo": "^6.5.0",
"nextra": "^2.13.4",
"nextra-theme-docs": "^2.13.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.2.1",
"react-syntax-highlighter": "^15.5.0",
"sharp": "^0.33.5",
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8477,13 +8477,13 @@ randombytes@^2.1.0:
dependencies:
safe-buffer "^5.1.0"

[email protected]:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
react-dom@^18.2.0:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4"
integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
dependencies:
loose-envify "^1.1.0"
scheduler "^0.23.0"
scheduler "^0.23.2"

react-icons@^5.2.1:
version "5.3.0"
Expand Down Expand Up @@ -8559,10 +8559,10 @@ [email protected]:
use-composed-ref "^1.3.0"
use-latest "^1.2.1"

[email protected]:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
react@^18.2.0:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
dependencies:
loose-envify "^1.1.0"

Expand Down Expand Up @@ -8899,7 +8899,7 @@ safe-stable-stringify@^2.1.0:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

scheduler@^0.23.0:
scheduler@^0.23.2:
version "0.23.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3"
integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==
Expand Down

0 comments on commit 7626702

Please sign in to comment.