fix(dashboard): broken af

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-11-20 14:19:48 +01:00
parent cd16ac878d
commit 9c8badd68d
7 changed files with 81 additions and 12 deletions

View File

@@ -13,14 +13,14 @@ import SideEffects from './side-effects';
interface AppLayoutProps {
children: React.ReactNode;
params: {
organizationId: string;
organizationSlug: string;
projectId: string;
};
}
export default async function AppLayout({
children,
params: { organizationId, projectId },
params: { organizationSlug: organizationId, projectId },
}: AppLayoutProps) {
const [organizations, projects, dashboards] = await Promise.all([
getCurrentOrganizations(),

View File

@@ -6,10 +6,10 @@ import { getInvites, getProjectsByOrganizationId } from '@openpanel/db';
import CreateInvite from './create-invite';
interface Props {
organizationId: string;
organizationSlug: string;
}
const InvitesServer = async ({ organizationId }: Props) => {
const InvitesServer = async ({ organizationSlug: organizationId }: Props) => {
const [invites, projects] = await Promise.all([
getInvites(organizationId),
getProjectsByOrganizationId(organizationId),

View File

@@ -3,10 +3,10 @@ import { MembersTable } from '@/components/settings/members';
import { getMembers, getProjectsByOrganizationId } from '@openpanel/db';
interface Props {
organizationId: string;
organizationSlug: string;
}
const MembersServer = async ({ organizationId }: Props) => {
const MembersServer = async ({ organizationSlug: organizationId }: Props) => {
const [members, projects] = await Promise.all([
getMembers(organizationId),
getProjectsByOrganizationId(organizationId),

View File

@@ -14,13 +14,13 @@ import MembersServer from './members';
interface PageProps {
params: {
organizationId: string;
organizationSlug: string;
};
searchParams: Record<string, string>;
}
export default async function Page({
params: { organizationId },
params: { organizationSlug: organizationId },
searchParams,
}: PageProps) {
const tab = parseAsStringEnum(['org', 'members', 'invites'])

View File

@@ -9,11 +9,13 @@ import ListProjects from './list-projects';
interface PageProps {
params: {
organizationId: string;
organizationSlug: string;
};
}
export default async function Page({ params: { organizationId } }: PageProps) {
export default async function Page({
params: { organizationSlug: organizationId },
}: PageProps) {
const [projects, clients] = await Promise.all([
getProjectsByOrganizationId(organizationId),
getClientsByOrganizationId(organizationId),

View File

@@ -8,17 +8,20 @@ import { getCurrentOrganizations, getCurrentProjects } from '@openpanel/db';
interface PageProps {
params: {
organizationId: string;
organizationSlug: string;
};
}
export default async function Page({ params: { organizationId } }: PageProps) {
export default async function Page({
params: { organizationSlug: organizationId },
}: PageProps) {
const [organizations, projects] = await Promise.all([
getCurrentOrganizations(),
getCurrentProjects(organizationId),
]);
const organization = organizations.find((org) => org.id === organizationId);
console.log(organizations, organizationId, projects);
if (!organization) {
return (