chore(API): cleanup remove unnused functions
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user