Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions apps/dashboard/app/(app)/projects/page.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
"use server";
import { getAuth } from "@/lib/auth";
import { db } from "@/lib/db";
import { notFound, redirect } from "next/navigation";
import { notFound } from "next/navigation";
import { Suspense } from "react";
import { ProjectsClient } from "./projects-client";

export default async function ProjectsPage(): Promise<JSX.Element> {
export default async function ProjectsPage() {
const { orgId } = await getAuth();
const workspace = await db.query.workspaces.findFirst({
where: (table, { and, eq, isNull }) => and(eq(table.orgId, orgId), isNull(table.deletedAtM)),
});

if (!workspace) {
return redirect("/new");
}

if (!workspace.betaFeatures.deployments) {
if (!workspace?.betaFeatures?.deployments) {
// right now, we want to block all external access to deploy
// to make it easier to opt-in for local development, comment out the redirect
// and uncomment the <OptIn> component
//return redirect("/apis");
return notFound();
}

return (
<Suspense fallback={<div>Loading...</div>}>
<ProjectsClient />
Expand Down
Loading