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:
@@ -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;
|
||||
|
||||
|
||||
@@ -203,6 +203,6 @@ export const CreateClan = () => {
|
||||
};
|
||||
|
||||
type Meta = Extract<
|
||||
OperationResponse<"show_clan_meta">,
|
||||
OperationResponse<"get_clan_details">,
|
||||
{ status: "success" }
|
||||
>["data"];
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -202,6 +202,6 @@ export const CreateClan = () => {
|
||||
};
|
||||
|
||||
type Meta = Extract<
|
||||
OperationResponse<"show_clan_meta">,
|
||||
OperationResponse<"get_clan_details">,
|
||||
{ status: "success" }
|
||||
>["data"];
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user