Send Test Notification Type fix

This commit is contained in:
headlesdev
2025-05-25 22:01:15 +02:00
parent fb13c2bfce
commit a218a7f8f3
4 changed files with 16 additions and 7 deletions

View File

@@ -49,10 +49,14 @@ const useNotifications = () => {
});
}
const testNotification = (notificationProviderId: number): Promise<string> | string => {
const testNotification = (notificationProviderId: number): Promise<number> | number => {
return axios.post('/api/notifications/test', { notificationProviderId })
.then((response) => {
return response.data.notificationTest;
if(response.data.notificationTest) {
return Number(response.data.notificationTest.id);
} else {
throw new Error('Notification test not found');
}
})
.catch(err => {
throw err.response?.data?.error || 'An error occurred';