Added remaining elements to alert dialog.

This commit is contained in:
2024-05-19 05:07:35 +02:00
parent 715e5ac58a
commit 014758241c
22 changed files with 1210 additions and 30 deletions

37
src/web/alerts.js Executable file
View File

@@ -0,0 +1,37 @@
import {
fetchAlerts,
createAlert,
removeAlert,
updateNotifications,
updateNotification,
} from '../alerts.js';
export async function fetchAlertsApi(req, res) {
const alerts = await fetchAlerts(req.user);
res.send(alerts);
}
export async function createAlertApi(req, res) {
const alertId = await createAlert(req.body, req.user);
res.send({ id: alertId });
}
export async function removeAlertApi(req, res) {
await removeAlert(req.params.alertId, req.user);
res.status(204).send();
}
export async function updateNotificationsApi(req, res) {
await updateNotifications(req.body, req.user);
res.status(204).send();
}
export async function updateNotificationApi(req, res) {
await updateNotification(req.params.notificationId, req.body, req.user);
res.status(204).send();
}