From 5af12b4f07b6753aa3fcc5528a2d2ed77b2e0080 Mon Sep 17 00:00:00 2001 From: kieran Date: Tue, 25 Feb 2025 15:15:20 +0000 Subject: [PATCH] fix: ssh_key_id --- src/api.ts | 4 ++-- src/pages/vm.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api.ts b/src/api.ts index 56d8142..44e4adc 100644 --- a/src/api.ts +++ b/src/api.ts @@ -94,7 +94,7 @@ export interface VmPayment { is_paid: boolean; } -export interface PathVm { +export interface PatchVm { ssh_key_id?: number; } @@ -132,7 +132,7 @@ export class LNVpsApi { return data; } - async patchVm(id: number, req: PathVm) { + async patchVm(id: number, req: PatchVm) { const { data } = await this.#handleResponse>( await this.#req(`/api/v1/vm/${id}`, "PATCH", req), ); diff --git a/src/pages/vm.tsx b/src/pages/vm.tsx index 31c40d5..2bf7fa7 100644 --- a/src/pages/vm.tsx +++ b/src/pages/vm.tsx @@ -26,7 +26,7 @@ export default function VmPage() { const [term] = useState(); const termRef = useRef(null); const [editKey, setEditKey] = useState(false); - const [key, setKey] = useState(state?.ssh_key_id ?? -1); + const [key, setKey] = useState(state?.ssh_key.id ?? -1); const renew = useCallback( async function () {