chore(API): cleanup remove unnused functions

This commit is contained in:
Johannes Kirschbauer
2025-05-06 12:05:02 +02:00
parent 929632049e
commit 00b12c2c51
9 changed files with 14 additions and 77 deletions

View File

@@ -10,7 +10,7 @@ import { Filter } from "../routes/machines";
import { Typography } from "./Typography";
import { Button } from "./button";
type MachineDetails = SuccessQuery<"list_inventory_machines">["data"][string];
type MachineDetails = SuccessQuery<"list_machines">["data"][string];
interface MachineListItemProps {
name: string;

View File

@@ -32,7 +32,7 @@ type MachineFormInterface = MachineData & {
disk?: string;
};
type MachineData = SuccessData<"get_inventory_machine_details">;
type MachineData = SuccessData<"get_machine_details">;
const steps: Record<StepIdx, string> = {
"1": "Hardware detection",
@@ -641,16 +641,11 @@ const MachineForm = (props: MachineDetailsProps) => {
export const MachineDetails = () => {
const params = useParams();
const genericQuery = createQuery(() => ({
queryKey: [
activeURI(),
"machine",
params.id,
"get_inventory_machine_details",
],
queryKey: [activeURI(), "machine", params.id, "get_machine_details"],
queryFn: async () => {
const curr = activeURI();
if (curr) {
const result = await callApi("get_inventory_machine_details", {
const result = await callApi("get_machine_details", {
flake_url: curr,
machine_name: params.id,
});

View File

@@ -18,7 +18,7 @@ import { Header } from "@/src/layout/header";
import { makePersisted } from "@solid-primitives/storage";
type MachinesModel = Extract<
OperationResponse<"list_inventory_machines">,
OperationResponse<"list_machines">,
{ status: "success" }
>["data"];
@@ -32,13 +32,13 @@ export const MachineListView: Component = () => {
const [filter, setFilter] = createSignal<Filter>({ tags: [] });
const inventoryQuery = createQuery<MachinesModel>(() => ({
queryKey: [activeURI(), "list_inventory_machines"],
queryKey: [activeURI(), "list_machines"],
placeholderData: {},
enabled: !!activeURI(),
queryFn: async () => {
const uri = activeURI();
if (uri) {
const response = await callApi("list_inventory_machines", {
const response = await callApi("list_machines", {
flake_url: uri,
});
if (response.status === "error") {