We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f24ef0 commit 3d235c3Copy full SHA for 3d235c3
npm-packages/dashboard/src/pages/t/[team]/[project]/usage.tsx
@@ -0,0 +1,24 @@
1
+import { GetServerSideProps } from "next";
2
+import { withAuthenticatedPage } from "lib/withAuthenticatedPage";
3
+
4
+export const getServerSideProps: GetServerSideProps = async ({ params }) => {
5
+ const team = params?.team;
6
+ const project = params?.project;
7
8
+ if (typeof team !== "string" || typeof project !== "string") {
9
+ throw new Error("Invalid team or project");
10
+ }
11
12
+ return {
13
+ redirect: {
14
+ destination: `/t/${team}/settings/usage?projectSlug=${encodeURIComponent(project)}`,
15
+ permanent: false,
16
+ },
17
+ };
18
+};
19
20
+function RedirectToTeamUsage() {
21
+ return null;
22
+}
23
24
+export default withAuthenticatedPage(RedirectToTeamUsage);
0 commit comments