mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Test Notifications client
This commit is contained in:
@@ -41,12 +41,23 @@ const useNotifications = () => {
|
||||
});
|
||||
}
|
||||
|
||||
const testNotification = (notificationProviderId: number): Promise<string> | string => {
|
||||
return axios.post('/api/notifications/test', { notificationProviderId })
|
||||
.then((response) => {
|
||||
return response.data.notificationTest;
|
||||
})
|
||||
.catch(err => {
|
||||
throw err.response?.data?.error || 'An error occurred';
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
notifications,
|
||||
loading,
|
||||
addNotification,
|
||||
deleteNotification,
|
||||
loadNotifications
|
||||
loadNotifications,
|
||||
testNotification
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user