mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-12 16:06:38 +00:00
fixed listSites endpoint
This commit is contained in:
@@ -12,7 +12,7 @@ export const metadata: Metadata = {
|
||||
const sidebarNavItems = [
|
||||
{
|
||||
title: "Profile",
|
||||
href: "/{orgId}/resources/{resourceId}/",
|
||||
href: "/{orgId}/resources/{resourceId}",
|
||||
},
|
||||
{
|
||||
title: "Appearance",
|
||||
|
||||
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
||||
const sidebarNavItems = [
|
||||
{
|
||||
title: "Profile",
|
||||
href: "/{orgId}/sites/{siteId}/",
|
||||
href: "/{orgId}/sites/{siteId}",
|
||||
},
|
||||
{
|
||||
title: "Appearance",
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
import Link from "next/link";
|
||||
import { internal } from "@app/api";
|
||||
import { authCookieHeader } from "@app/api/cookies";
|
||||
import { ListSitesResponse } from "@server/routers/site";
|
||||
import { AxiosResponse } from "axios";
|
||||
|
||||
type SitesPageProps = {
|
||||
params: { orgId: string };
|
||||
};
|
||||
|
||||
export default async function Page({ params }: SitesPageProps) {
|
||||
let sites: ListSitesResponse["sites"] = [];
|
||||
try {
|
||||
const res = await internal.get<AxiosResponse<ListSitesResponse>>(
|
||||
`/org/${params.orgId}/sites`,
|
||||
authCookieHeader(),
|
||||
);
|
||||
sites = res.data.data.sites;
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<div className="space-y-0.5 select-none">
|
||||
|
||||
Reference in New Issue
Block a user