mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Applicatin & Server Settings
This commit is contained in:
@@ -74,6 +74,46 @@ const useNotifications = () => {
|
||||
});
|
||||
}
|
||||
|
||||
const getNotificationApplicationsSettings = (): Promise<string> | string => {
|
||||
return axios.get('/api/notifications/settings_applications_get')
|
||||
.then((response) => {
|
||||
return response.data.notification;
|
||||
})
|
||||
.catch(err => {
|
||||
throw err.response?.data?.error || 'An error occurred';
|
||||
});
|
||||
}
|
||||
|
||||
const getNotificationServerSettings = (): Promise<string> | string => {
|
||||
return axios.get('/api/notifications/settings_server_get')
|
||||
.then((response) => {
|
||||
return response.data.notification;
|
||||
})
|
||||
.catch(err => {
|
||||
throw err.response?.data?.error || 'An error occurred';
|
||||
});
|
||||
}
|
||||
|
||||
const editNotificationApplicationsSettings = (settings: any): Promise<string> | string => {
|
||||
return axios.post('/api/notifications/settings_applications_edit', settings)
|
||||
.then((response) => {
|
||||
return response.data.notificationSettings;
|
||||
})
|
||||
.catch(err => {
|
||||
throw err.response?.data?.error || 'An error occurred';
|
||||
});
|
||||
}
|
||||
|
||||
const editNotificationServerSettings = (settings: any): Promise<string> | string => {
|
||||
return axios.post('/api/notifications/settings_server_edit', settings)
|
||||
.then((response) => {
|
||||
return response.data.notificationSettings;
|
||||
})
|
||||
.catch(err => {
|
||||
throw err.response?.data?.error || 'An error occurred';
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
notifications,
|
||||
loading,
|
||||
@@ -82,7 +122,11 @@ const useNotifications = () => {
|
||||
loadNotifications,
|
||||
testNotification,
|
||||
getNotificationTest,
|
||||
notificationTest
|
||||
notificationTest,
|
||||
getNotificationApplicationsSettings,
|
||||
getNotificationServerSettings,
|
||||
editNotificationApplicationsSettings,
|
||||
editNotificationServerSettings
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user