fix: clear custom payload when switching webhook types (addresses #378)

When switching from generic webhook to discord or other service types,
the custom payload template was persisting and being sent incorrectly.
Now clears the payload template when switching to non-generic services.
This commit is contained in:
Pulse Monitor
2025-08-31 08:21:30 +00:00
parent cf03e6f742
commit 54fc48b8d1
@@ -115,7 +115,10 @@ export function WebhookConfig(props: WebhookConfigProps) {
service: template.service,
method: template.method,
headers: { ...template.headers },
name: formData().name || template.name
name: formData().name || template.name,
// Clear the payload template when switching services
// Only generic service should have custom payloads
payloadTemplate: service === 'generic' ? formData().payloadTemplate : ''
});
}
setShowServiceDropdown(false);