From 1b4d81d467bfa54c335efc8eeb73949a6789343f Mon Sep 17 00:00:00 2001 From: Derick M <58572875+TurtIeSocks@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:50:46 -0500 Subject: [PATCH] fix: add logging and fix dest --- packages/client/src/app/status/statusPage.tsx | 2 +- packages/server/src/index.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/client/src/app/status/statusPage.tsx b/packages/client/src/app/status/statusPage.tsx index 119d427..72cd2ed 100644 --- a/packages/client/src/app/status/statusPage.tsx +++ b/packages/client/src/app/status/statusPage.tsx @@ -20,7 +20,7 @@ export const StatusPage = (): JSX.Element => { const cancel = new AbortController(); const timer = setTimeout(() => cancel.abort(), 5000); try { - await fetch('/api/device/delete', { method: 'DELETE', signal: cancel.signal }); + await fetch('/api/device', { method: 'DELETE', signal: cancel.signal }); } catch (e) { console.error(e); } finally { diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index a4ab889..7eee8e3 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -465,6 +465,7 @@ const routes = async (fastifyInstance: FastifyInstance) => { }); fastifyInstance.delete('/api/device', async (request, reply) => { + log.info('Received delete all devices request'); const deviceIds = Object.keys(controlConnections); let deleted = 0; for (const deviceId of deviceIds) { @@ -475,6 +476,7 @@ const routes = async (fastifyInstance: FastifyInstance) => { deleted++; } } + log.info(`Deleted ${deleted} devices`); return reply.code(200).send({ status: 'ok', error: `Deleted ${deleted} devices` }); });