From 78377c0479c17b0f4801e181fc601b6c38a55ff5 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Sat, 3 Jun 2023 00:10:33 +0000 Subject: [PATCH] fix handleResponse responding with proxmox task status Signed-off-by: Arthur Lu --- pve.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pve.js b/pve.js index 8138b1a..178ba29 100644 --- a/pve.js +++ b/pve.js @@ -35,7 +35,7 @@ export async function requestPVE(path, method, cookies, body = null, token = nul export async function handleResponse(node, result, res) { const waitFor = delay => new Promise(resolve => setTimeout(resolve, delay)); - if (result.data.data && typeof(result.data.data) === String && result.data.data.startsWith("UPID:")) { + if (result.data.data && typeof(result.data.data) === "string" && result.data.data.startsWith("UPID:")) { let upid = result.data.data; while (true) { let taskStatus = await requestPVE(`/nodes/${node}/tasks/${upid}/status`, "GET", null, null, pveAPIToken);