mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
refactoring some files.
This commit is contained in:
@@ -1,29 +1,30 @@
|
||||
import Link from 'next/link'
|
||||
|
||||
import {PageParams} from "@/types/next";
|
||||
import {prisma} from "@/prisma";
|
||||
import {CardsWithPagination} from "@/components/wrappers/common/cards-with-pagination";
|
||||
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";
|
||||
import {getCurrentOrganizationId} from "@/features/dashboard/organization-cookie";
|
||||
|
||||
|
||||
export default async function RoutePage(props: PageParams<{}>) {
|
||||
|
||||
// const {searchParams} = props
|
||||
// const organizationId = searchParams?.organizationId || "default";
|
||||
|
||||
const user = await requiredCurrentUser()
|
||||
|
||||
const currentOrganizationId = await getCurrentOrganizationId()
|
||||
|
||||
const projects = await prisma.project.findMany({
|
||||
where: {
|
||||
organization: {
|
||||
slug: "default",
|
||||
// id: organizationId,
|
||||
users: {
|
||||
some: {
|
||||
userId: user.id
|
||||
},
|
||||
},
|
||||
id: currentOrganizationId,
|
||||
// users: {
|
||||
// some: {
|
||||
// userId: user.id
|
||||
// },
|
||||
// },
|
||||
}
|
||||
},
|
||||
include: {
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
import {prisma} from "@/prisma";
|
||||
import {PageParams} from "@/types/next";
|
||||
import {Page, PageContent, PageDescription, PageHeader, PageTitle} from "@/features/layout/page";
|
||||
import {Page, PageActions, PageContent, PageDescription, PageHeader, PageTitle} from "@/features/layout/page";
|
||||
import {requiredCurrentUser} from "@/auth/current-user";
|
||||
import {SettingsTabs} from "@/components/wrappers/dashboard/settings/SettingsTabs/SettingsTabs";
|
||||
import {getCurrentOrganizationId} from "@/features/dashboard/organization-cookie";
|
||||
import {Button} from "@/components/ui/button";
|
||||
import {ButtonWithConfirm} from "@/components/wrappers/common/button/button-with-confirm";
|
||||
|
||||
|
||||
export default async function RoutePage(props: PageParams<{}>) {
|
||||
const user = await requiredCurrentUser()
|
||||
|
||||
const defaultOrganization = await prisma.organization.findUnique({
|
||||
where: {slug: "default"},
|
||||
});
|
||||
const currentOrganizationId = await getCurrentOrganizationId()
|
||||
|
||||
const users = await prisma.user.findMany({
|
||||
where: {
|
||||
organizations: {
|
||||
some: {
|
||||
organizationId: defaultOrganization.id
|
||||
organizationId: currentOrganizationId
|
||||
},
|
||||
},
|
||||
deleted: {not: true},
|
||||
@@ -38,6 +39,10 @@ export default async function RoutePage(props: PageParams<{}>) {
|
||||
<PageTitle>
|
||||
Settings
|
||||
</PageTitle>
|
||||
<PageActions>
|
||||
{/*<Button variant="destructive">Delete Organization</Button>*/}
|
||||
<ButtonWithConfirm text="Delete Organization" variant="destructive"/>
|
||||
</PageActions>
|
||||
</PageHeader>
|
||||
<PageDescription>
|
||||
Manage your organization settings.
|
||||
|
||||
Reference in New Issue
Block a user