Merge pull request #1904 from bluewave-labs/feat/handleTestNotification

Implemented the handleTestNotification function.
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-03-19 08:59:22 -07:00
commit 97e4eb557d
7 files changed
+233 -28

No files matched your search

+22
View File
@@ -669,6 +669,28 @@ class NetworkService {
});
}
/**
* ************************************
* Test a notification integration
* ************************************
*
* @async
* @param {Object} config - The configuration object.
* @param {string} config.platform - The notification platform (slack, discord, telegram, webhook).
* @param {Object} config.payload - The payload with configuration for the notification.
* @returns {Promise<AxiosResponse>} The response from the axios POST request.
*/
async testNotification(config) {
return this.axiosInstance.post('/notifications/test-webhook', {
platform: config.platform,
...config.payload
}, {
headers: {
"Content-Type": "application/json",
},
});
}
/**
* ************************************
* Creates a maintenance window