From fab13597d8dfbefb25053ff78db2fad80feba30c Mon Sep 17 00:00:00 2001 From: routerino <45954722+routerino@users.noreply.github.com> Date: Sun, 18 Jun 2023 19:55:15 +1000 Subject: [PATCH] Revert "Add button to delete machine route" This reverts commit 63041fd673d81da56e60d2b528a4991981eab746. --- .../devices/DeviceCard/DeviceRoutes.svelte | 28 +++---------------- .../devices/DeviceCard/DeviceRoutesAPI.svelte | 26 ----------------- 2 files changed, 4 insertions(+), 50 deletions(-) diff --git a/src/lib/devices/DeviceCard/DeviceRoutes.svelte b/src/lib/devices/DeviceCard/DeviceRoutes.svelte index 2168ba2..59f606f 100644 --- a/src/lib/devices/DeviceCard/DeviceRoutes.svelte +++ b/src/lib/devices/DeviceCard/DeviceRoutes.svelte @@ -1,5 +1,5 @@ Device Routes diff --git a/src/lib/devices/DeviceCard/DeviceRoutesAPI.svelte b/src/lib/devices/DeviceCard/DeviceRoutesAPI.svelte index 09f09c8..f43d34c 100644 --- a/src/lib/devices/DeviceCard/DeviceRoutesAPI.svelte +++ b/src/lib/devices/DeviceCard/DeviceRoutesAPI.svelte @@ -80,30 +80,4 @@ throw error; }); } - - export async function deleteDeviceRoute(routeID: number): Promise { - // variables in local storage - let headscaleURL = localStorage.getItem('headscaleURL') || ''; - let headscaleAPIKey = localStorage.getItem('headscaleAPIKey') || ''; - let endpointURL = `/api/v1/routes/${routeID}`; - - await fetch(headscaleURL + endpointURL, { - method: 'DELETE', - headers: { - Accept: 'application/json', - Authorization: `Bearer ${headscaleAPIKey}` - } - }) - .then((response) => { - if (response.ok) { - } else { - return response.text().then((text) => { - throw JSON.parse(text).message; - }); - } - }) - .catch((error) => { - throw error; - }); - }