mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-23 03:33:53 +00:00
fix: URL-encode alert IDs in API calls to fix acknowledgement
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user