mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Patch force dynamic route for dashboard/agent
This commit is contained in:
@@ -39,7 +39,6 @@ jobs:
|
|||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
target: prod
|
target: prod
|
||||||
build-args: DATABASE_URL=""
|
|
||||||
|
|
||||||
# - name: Generate artifact attestation
|
# - name: Generate artifact attestation
|
||||||
# uses: actions/attest-build-provenance@v2
|
# uses: actions/attest-build-provenance@v2
|
||||||
|
|||||||
@@ -5,13 +5,17 @@ import {Button} from "@/components/ui/button";
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import {Page, PageActions, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
import {Page, PageActions, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
|
import {notFound} from "next/navigation";
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{}>) {
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
|
||||||
const agents = await prisma.agent.findMany({})
|
const agents = await prisma.agent.findMany()
|
||||||
|
|
||||||
|
|
||||||
|
if(!agents){
|
||||||
|
notFound()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import {currentUser} from "@/auth/current-user";
|
import {currentUser, requiredCurrentUser} from "@/auth/current-user";
|
||||||
import {notFound} from "next/navigation";
|
import {notFound} from "next/navigation";
|
||||||
|
|
||||||
export default async function Layout({children}: { children: React.ReactNode }) {
|
export default async function Layout({children}: { children: React.ReactNode }) {
|
||||||
|
|
||||||
const user = await currentUser()
|
const user = await requiredCurrentUser()
|
||||||
|
|
||||||
if(user.role != "admin"){
|
if(user.role != "admin"){
|
||||||
notFound()
|
notFound()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user