feat: enhance custom notification handling and schema

- Updated the custom notification type to include an array of headers, allowing for more flexible header management.
- Removed the obsolete KeyValueInput component, streamlining the notification settings interface.
- Adjusted the database schema to support JSONB for headers in the custom table, improving data handling.
- Enhanced the notification testing functionality to accommodate the new headers structure.
- Updated related API endpoints and utility functions to reflect these changes.
This commit is contained in:
Mauricio Siu
2025-12-07 13:42:30 -06:00
parent 212006ba9e
commit 5412c5a873
8 changed files with 7069 additions and 201 deletions
@@ -181,17 +181,11 @@ export const sendCustomNotification = async (
payload: Record<string, any>,
) => {
try {
// Parse headers if provided
let headers: Record<string, string> = {
// Merge default headers with custom headers (now already an object from jsonb)
const headers: Record<string, string> = {
"Content-Type": "application/json",
...(connection.headers || {}),
};
if (connection.headers) {
try {
headers = { ...headers, ...JSON.parse(connection.headers) };
} catch (error) {
console.error("Error parsing headers:", error);
}
}
// Default body with payload
const body = JSON.stringify(payload);