mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Send Test Notification Type fix
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user