mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-29 16:22:16 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user