Added remaining elements to alert dialog.
This commit is contained in:
37
src/web/alerts.js
Executable file
37
src/web/alerts.js
Executable 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();
|
||||
}
|
||||
Reference in New Issue
Block a user