Skip to content

Commit 60f3c4f

Browse files
committed
display global variable charts
Took 53 seconds
1 parent 60faef0 commit 60f3c4f

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Metadata } from "next"
2+
import { redirect } from "next/navigation"
3+
4+
import { authOptions } from "@/lib/auth"
5+
import { getCurrentUser } from "@/lib/session"
6+
import { GlobalVariableCharts } from "@/components/globalVariables/global-variable-charts"
7+
import { Shell } from "@/components/layout/shell"
8+
9+
export const metadata: Metadata = {
10+
title: "Global Variable Charts",
11+
}
12+
13+
interface GlobalVariableEditProps {
14+
params: { variableId: string }
15+
}
16+
17+
export default async function GlobalVariableChart({
18+
params,
19+
}: GlobalVariableEditProps) {
20+
const user = await getCurrentUser()
21+
22+
if (!user) {
23+
redirect(authOptions?.pages?.signIn || "/signin")
24+
}
25+
const variableId = parseInt(params.variableId)
26+
return (
27+
<Shell>
28+
<div className="grid grid-cols-1 gap-10">
29+
<GlobalVariableCharts variableId={variableId} />
30+
</div>
31+
</Shell>
32+
)
33+
}

app/dashboard/globalVariables/[variableId]/settings/page.tsx renamed to app/dfda/globalVariables/[variableId]/settings/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ export default async function GlobalVariableEdit({
2323
if (!user) {
2424
redirect(authOptions?.pages?.signIn || "/signin")
2525
}
26+
debugger
2627

2728
const response = await fetch(
28-
`/api/dfda/variables?variableId=${params.variableId}&includeCharts=0`
29+
`${process.env.NEXT_PUBLIC_APP_URL}/api/dfda/variables?variableId=${params.variableId}&includeCharts=0`
2930
)
3031
const globalVariables = await response.json()
3132
const globalVariable = globalVariables[0]
File renamed without changes.

0 commit comments

Comments
 (0)