mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
import {prisma} from "@/prisma";
|
|
import {PageParams} from "@/types/next";
|
|
import {Page, PageContent, PageDescription, PageHeader, PageTitle} from "@/features/layout/page";
|
|
import {requiredCurrentUser} from "@/auth/current-user";
|
|
import {SettingsTabs} from "@/components/wrappers/Dashboard/Settings/SettingsTabs/SettingsTabs";
|
|
|
|
|
|
export default async function RoutePage(props: PageParams<{}>) {
|
|
const user = await requiredCurrentUser()
|
|
|
|
const defaultOrganization = await prisma.organization.findUnique({
|
|
where: {slug: "default"},
|
|
});
|
|
|
|
const users = await prisma.user.findMany({
|
|
where: {
|
|
organizations: {
|
|
some: {
|
|
organizationId: defaultOrganization.id
|
|
},
|
|
},
|
|
deleted: {not: true},
|
|
|
|
}
|
|
})
|
|
|
|
console.log(users)
|
|
|
|
const settings = await prisma.settings.findUnique({
|
|
where: {
|
|
name: "system"
|
|
}
|
|
})
|
|
|
|
return (
|
|
<Page>
|
|
<PageHeader>
|
|
<PageTitle>
|
|
Settings
|
|
</PageTitle>
|
|
</PageHeader>
|
|
<PageDescription>
|
|
Manage your organization settings.
|
|
</PageDescription>
|
|
<PageContent>
|
|
<SettingsTabs settings={settings} currentUser={user} users={users}/>
|
|
</PageContent>
|
|
</Page>
|
|
)
|
|
} |