Merge pull request 'api/clan: rename 'show_clan_meta' -> 'get_clan_details'' (#4236) from api-cleanup into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4236
This commit is contained in:
hsjobeki
2025-07-07 10:00:10 +00:00
17 changed files with 109 additions and 102 deletions

View File

@@ -13,7 +13,7 @@ export const clanMetaQuery = (uri: string | undefined = undefined) =>
queryFn: async () => {
console.log("fetching clan meta", clanURI);
const result = await callApi("show_clan_meta", {
const result = await callApi("get_clan_details", {
flake: { identifier: clanURI! },
}).promise;

View File

@@ -203,6 +203,6 @@ export const CreateClan = () => {
};
type Meta = Extract<
OperationResponse<"show_clan_meta">,
OperationResponse<"get_clan_details">,
{ status: "success" }
>["data"];

View File

@@ -128,7 +128,7 @@ const EditClanForm = (props: EditClanFormProps) => {
);
};
type GeneralData = SuccessQuery<"show_clan_meta">["data"];
type GeneralData = SuccessQuery<"get_clan_details">["data"];
export const ClanDetails = () => {
const params = useParams();

View File

@@ -100,7 +100,7 @@ export const Flash = () => {
const deviceQuery = createQuery(() => ({
queryKey: ["block_devices"],
queryFn: async () => {
const result = await callApi("show_block_devices", {}).promise;
const result = await callApi("list_block_devices", {}).promise;
if (result.status === "error") throw new Error("Failed to fetch data");
return result.data;
},

View File

@@ -4,7 +4,7 @@ import { Button } from "../../components/Button/Button";
import Icon from "@/src/components/icon";
type ServiceModel = Extract<
OperationResponse<"show_mdns">,
OperationResponse<"list_mdns_services">,
{ status: "success" }
>["data"]["services"];
@@ -16,7 +16,7 @@ export const HostList: Component = () => {
<div class="" data-tip="Refresh install targets">
<Button
variant="light"
onClick={() => callApi("show_mdns", {})}
onClick={() => callApi("list_mdns_services", {})}
startIcon={<Icon icon="Update" />}
></Button>
</div>

View File

@@ -71,7 +71,7 @@ export const HWStep = (props: StepProps<HardwareValues>) => {
const hwReportQuery = useQuery(() => ({
queryKey: [props.dir, props.machine_id, "hw_report"],
queryFn: async () => {
const result = await callApi("show_machine_hardware_config", {
const result = await callApi("describe_machine_hardware", {
machine: {
flake: {
identifier: props.dir,

View File

@@ -13,7 +13,7 @@ export const clanMetaQuery = (uri: string | undefined = undefined) =>
queryFn: async () => {
console.log("fetching clan meta", clanURI);
const result = await callApi("show_clan_meta", {
const result = await callApi("get_clan_details", {
flake: { identifier: clanURI! },
}).promise;

View File

@@ -202,6 +202,6 @@ export const CreateClan = () => {
};
type Meta = Extract<
OperationResponse<"show_clan_meta">,
OperationResponse<"get_clan_details">,
{ status: "success" }
>["data"];

View File

@@ -128,7 +128,7 @@ const EditClanForm = (props: EditClanFormProps) => {
);
};
type GeneralData = SuccessQuery<"show_clan_meta">["data"];
type GeneralData = SuccessQuery<"get_clan_details">["data"];
export const ClanDetails = () => {
const params = useParams();

View File

@@ -4,7 +4,7 @@ import { Button } from "../../components/Button/Button";
import Icon from "@/src/components/icon";
type ServiceModel = Extract<
OperationResponse<"show_mdns">,
OperationResponse<"list_mdns_services">,
{ status: "success" }
>["data"]["services"];
@@ -16,7 +16,7 @@ export const HostList: Component = () => {
<div class="" data-tip="Refresh install targets">
<Button
variant="light"
onClick={() => callApi("show_mdns", {})}
onClick={() => callApi("list_mdns_services", {})}
startIcon={<Icon icon="Update" />}
></Button>
</div>