From b81b7eb641d6d3720ea8a69002bc5c61c4fc3e4f Mon Sep 17 00:00:00 2001 From: rcourtman Date: Wed, 1 Oct 2025 10:38:22 +0000 Subject: [PATCH] fix: URL-encode alert IDs in API calls to fix acknowledgement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alert IDs containing special characters (colons and slashes) were not being URL-encoded before use in API endpoints, causing the backend to fail to find and acknowledge alerts. This fixes issue #482. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- frontend-modern/src/api/alerts.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend-modern/src/api/alerts.ts b/frontend-modern/src/api/alerts.ts index f043f3793..96e2aa726 100644 --- a/frontend-modern/src/api/alerts.ts +++ b/frontend-modern/src/api/alerts.ts @@ -34,14 +34,14 @@ export class AlertsAPI { // Removed unused config methods - not implemented in backend static async acknowledge(alertId: string, user?: string): Promise<{ success: boolean }> { - return apiFetchJSON(`${this.baseUrl}/${alertId}/acknowledge`, { + return apiFetchJSON(`${this.baseUrl}/${encodeURIComponent(alertId)}/acknowledge`, { method: 'POST', body: JSON.stringify({ user }), }); } static async unacknowledge(alertId: string): Promise<{ success: boolean }> { - return apiFetchJSON(`${this.baseUrl}/${alertId}/unacknowledge`, { + return apiFetchJSON(`${this.baseUrl}/${encodeURIComponent(alertId)}/unacknowledge`, { method: 'POST', }); } @@ -59,7 +59,7 @@ export class AlertsAPI { } static async clearAlert(alertId: string): Promise<{ success: boolean }> { - return apiFetchJSON(`${this.baseUrl}/${alertId}/clear`, { + return apiFetchJSON(`${this.baseUrl}/${encodeURIComponent(alertId)}/clear`, { method: 'POST', }); }