mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
adding organization feature.
This commit is contained in:
@@ -32,10 +32,13 @@ export default async function RoutePage(props: PageParams<{
|
||||
const availableDatabases = await prisma.database.findMany({
|
||||
where: {
|
||||
OR: [
|
||||
{ projectId: null },
|
||||
{ projectId: project.id },
|
||||
{projectId: null},
|
||||
{projectId: project.id},
|
||||
],
|
||||
},
|
||||
include: {
|
||||
agent: {}
|
||||
},
|
||||
orderBy: {
|
||||
createdAt: 'desc',
|
||||
},
|
||||
@@ -50,7 +53,8 @@ export default async function RoutePage(props: PageParams<{
|
||||
</PageTitle>
|
||||
</PageHeader>
|
||||
<PageContent>
|
||||
<ProjectForm organization={organization} databases={availableDatabases} defaultValues={project} projectId={project.id}/>
|
||||
<ProjectForm organization={organization} databases={availableDatabases} defaultValues={project}
|
||||
projectId={project.id}/>
|
||||
</PageContent>
|
||||
</Page>
|
||||
)
|
||||
|
||||
@@ -10,6 +10,9 @@ export default async function RoutePage(props: PageParams<{}>) {
|
||||
where: {
|
||||
projectId: null
|
||||
},
|
||||
include: {
|
||||
agent: {}
|
||||
},
|
||||
orderBy: {
|
||||
createdAt: 'desc',
|
||||
},
|
||||
|
||||
@@ -5,17 +5,28 @@ import {Button} from "@/components/ui/button";
|
||||
import Link from 'next/link'
|
||||
import {Page, PageActions, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||
import {ProjectCard} from "@/components/wrappers/Dashboard/Projects/ProjectCard/ProjectCard";
|
||||
import {requiredCurrentUser} from "@/auth/current-user";
|
||||
|
||||
export default async function RoutePage(props: PageParams<{}>) {
|
||||
|
||||
// const {searchParams} = props
|
||||
// const organizationId = searchParams?.organizationId || "default";
|
||||
|
||||
const user = await requiredCurrentUser()
|
||||
|
||||
const projects = await prisma.project.findMany({
|
||||
where: {
|
||||
organization: {
|
||||
slug: "default",
|
||||
// id: organizationId,
|
||||
users: {
|
||||
some: {
|
||||
userId: user.id
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
include:{
|
||||
include: {
|
||||
databases: {}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user