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