mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-29 06:10:47 +00:00
♻️ refactor
This commit is contained in:
@@ -49,7 +49,7 @@ async function queryBlueprints(orgId: string, limit: number, offset: number) {
|
||||
}
|
||||
|
||||
export type ListBlueprintsResponse = {
|
||||
domains: NonNullable<Awaited<ReturnType<typeof queryBlueprints>>>;
|
||||
blueprints: NonNullable<Awaited<ReturnType<typeof queryBlueprints>>>;
|
||||
pagination: { total: number; limit: number; offset: number };
|
||||
};
|
||||
|
||||
@@ -108,7 +108,7 @@ export async function listBlueprints(
|
||||
|
||||
return response<ListBlueprintsResponse>(res, {
|
||||
data: {
|
||||
domains: blueprintsList,
|
||||
blueprints: blueprintsList,
|
||||
pagination: {
|
||||
total: count,
|
||||
limit,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import BlueprintsTable, { type BlueprintRow } from "@app/components/BlueprintsTable";
|
||||
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
||||
import { internal } from "@app/lib/api";
|
||||
import { authCookieHeader } from "@app/lib/api/cookies";
|
||||
@@ -19,13 +20,13 @@ type BluePrintsPageProps = {
|
||||
export default async function BluePrintsPage(props: BluePrintsPageProps) {
|
||||
const params = await props.params;
|
||||
|
||||
let blueprints: any[] = [];
|
||||
let blueprints: BlueprintRow[] = [];
|
||||
try {
|
||||
const res = await internal.get<
|
||||
AxiosResponse<ListBlueprintsResponse>
|
||||
>(`/org/${params.orgId}/domains`, await authCookieHeader());
|
||||
|
||||
blueprints = res.data.data.domains as any[];
|
||||
blueprints = res.data.data.blueprints
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
@@ -55,7 +56,7 @@ export default async function BluePrintsPage(props: BluePrintsPageProps) {
|
||||
title={t("blueprints")}
|
||||
description={t("blueprintsDescription")}
|
||||
/>
|
||||
{/* <DomainsTable domains={domains} /> */}
|
||||
<BlueprintsTable blueprints={blueprints} />
|
||||
</OrgProvider>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user