fix db relations + display sandboxes on dash
This commit is contained in:
@ -2,6 +2,7 @@ import { UserButton, currentUser } from "@clerk/nextjs"
|
||||
import { redirect } from "next/navigation"
|
||||
import Dashboard from "@/components/dashboard"
|
||||
import Navbar from "@/components/dashboard/navbar"
|
||||
import { Sandbox } from "@/lib/types"
|
||||
|
||||
export default async function DashboardPage() {
|
||||
const user = await currentUser()
|
||||
@ -10,10 +11,17 @@ export default async function DashboardPage() {
|
||||
redirect("/")
|
||||
}
|
||||
|
||||
const res = await fetch(
|
||||
`http://localhost:8787/api/user/sandbox?id=${user.id}`
|
||||
)
|
||||
const data = (await res.json()).sandbox as Sandbox[]
|
||||
|
||||
console.log(data)
|
||||
|
||||
return (
|
||||
<div className="w-screen h-screen flex flex-col overflow-hidden overscroll-none">
|
||||
<Navbar />
|
||||
<Dashboard />
|
||||
<Dashboard sandboxes={data} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user