From 12ad2fa30071ba319d93eeab8d9db1582c82cb49 Mon Sep 17 00:00:00 2001 From: Zachariah Ngonyani Date: Thu, 16 Oct 2025 02:58:21 +0300 Subject: [PATCH] fix: add missing authentication headers to individual service log clearing - Add authentication token to clearServiceLogs function in ServiceOperations - Fixes 401 Unauthorized error when clearing logs for individual services - Ensures consistency with other log operation authentication --- web/src/services/serviceOperations.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/src/services/serviceOperations.ts b/web/src/services/serviceOperations.ts index 7289ab5..f001cc2 100644 --- a/web/src/services/serviceOperations.ts +++ b/web/src/services/serviceOperations.ts @@ -353,8 +353,17 @@ export class ServiceOperations { serviceId: string, ): Promise { try { + const token = localStorage.getItem("authToken"); + if (!token) { + throw new Error("No authentication token"); + } + const response = await fetch(`/api/services/${serviceId}/logs`, { method: "DELETE", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${token}`, + }, }); if (!response.ok) { throw new Error(