File tree Expand file tree Collapse file tree 5 files changed +35
-1
lines changed Expand file tree Collapse file tree 5 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 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+ }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments