Skip to content

Commit 3d235c3

Browse files
NicolappsConvex, Inc.
authored and
Convex, Inc.
committed
Add a redirection for project usage (#36146)
Redirects `/t/{team}/{project}/usage` to `/t/{team}/settings/usage?projectSlug={project}` GitOrigin-RevId: 87f5792670634deddee51e0a8f05f3e91965bf2f
1 parent 1f24ef0 commit 3d235c3

File tree

1 file changed

+24
-0
lines changed
  • npm-packages/dashboard/src/pages/t/[team]/[project]

1 file changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)