Applicatin & Server Settings

This commit is contained in:
headlesdev
2025-05-26 12:26:39 +02:00
parent 338c1922d0
commit 61a9442443
3 changed files with 465 additions and 19 deletions

View File

@@ -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
};
}