Skip to content

Commit

Permalink
fix: redirect 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
euije committed Mar 2, 2024
1 parent 7869a1d commit 4c53123
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"@primer/react": "^35.28.0",
"@tanstack/react-query": "^5.17.0",
"@tanstack/react-query-devtools": "^5.17.21",
"@vercel/analytics": "^1.2.2",
"@vercel/speed-insights": "^1.0.10",
"autoprefixer": "10.4.15",
"axios": "^1.5.0",
"classnames": "^2.5.1",
Expand Down
4 changes: 4 additions & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import { Html, Head, Main, NextScript } from 'next/document';
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';

export default function Document() {
return (
Expand All @@ -8,6 +10,8 @@ export default function Document() {
<body>
<Main />
<NextScript />
<Analytics />
<SpeedInsights />
</body>
</Html>
);
Expand Down
5 changes: 5 additions & 0 deletions pages/school-attack/[groupId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import {
getSchoolAttackStatisticsLikeGroupName,
} from '@/repository/statistics';
import { GetServerSideProps, InferGetServerSidePropsType } from 'next';
import { redirect } from 'next/navigation';

const maxWidth = 425;

Expand Down Expand Up @@ -518,5 +519,9 @@ const getServerSideProps = (async (context) => {
props: {
dehydratedState: dehydrate(queryClient),
},
redirect: {
destination: `/school-attack/${encoded}`,
permanent: false,
},
};
}) satisfies GetServerSideProps;
53 changes: 53 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,50 @@ __metadata:
languageName: node
linkType: hard

"@vercel/analytics@npm:^1.2.2":
version: 1.2.2
resolution: "@vercel/analytics@npm:1.2.2"
dependencies:
server-only: ^0.0.1
peerDependencies:
next: ">= 13"
react: ^18 || ^19
peerDependenciesMeta:
next:
optional: true
react:
optional: true
checksum: 5913caeb2077d3d9c2eddabed90e40e29762e9e53941d3e1337daa0a60423ffef2a2c0b5a743ff37ea1aa9cfe7eb3159e4dff91cd4843a8503be5680c2faa98d
languageName: node
linkType: hard

"@vercel/speed-insights@npm:^1.0.10":
version: 1.0.10
resolution: "@vercel/speed-insights@npm:1.0.10"
peerDependencies:
"@sveltejs/kit": ^1 || ^2
next: ">= 13"
react: ^18 || ^19
svelte: ^4
vue: ^3
vue-router: ^4
peerDependenciesMeta:
"@sveltejs/kit":
optional: true
next:
optional: true
react:
optional: true
svelte:
optional: true
vue:
optional: true
vue-router:
optional: true
checksum: 26171c424ed725bbb82020818428a37e54715dfba58ae8ccff53c1bb58787f3713a9d8695afbbb5439555b92614f099fdb5188f80d9855818fddf7c192e8033e
languageName: node
linkType: hard

"abbrev@npm:^2.0.0":
version: 2.0.0
resolution: "abbrev@npm:2.0.0"
Expand Down Expand Up @@ -5788,6 +5832,13 @@ __metadata:
languageName: node
linkType: hard

"server-only@npm:^0.0.1":
version: 0.0.1
resolution: "server-only@npm:0.0.1"
checksum: c432348956641ea3f460af8dc3765f3a1bdbcf7a1e0205b0756d868e6e6fe8934cdee6bff68401a1dd49ba4a831c75916517a877446d54b334f7de36fa273e53
languageName: node
linkType: hard

"shallowequal@npm:^1.1.0":
version: 1.1.0
resolution: "shallowequal@npm:1.1.0"
Expand Down Expand Up @@ -6819,6 +6870,8 @@ __metadata:
"@types/react-dom": 18.2.7
"@typescript-eslint/eslint-plugin": ^6.14.0
"@typescript-eslint/parser": ^6.14.0
"@vercel/analytics": ^1.2.2
"@vercel/speed-insights": ^1.0.10
autoprefixer: 10.4.15
axios: ^1.5.0
classnames: ^2.5.1
Expand Down

0 comments on commit 4c53123

Please sign in to comment.