feat: add bulk actions to the Notifications page

Signed-off-by: Marek Libra <marek.libra@gmail.com>
This commit is contained in:
Marek Libra
2024-03-17 11:27:37 +01:00
parent 16fb59bed4
commit ec40998df3
6 changed files with 294 additions and 122 deletions
@@ -229,6 +229,13 @@ export async function createRouter(
});
});
router.get('/status', async (req, res) => {
const user = await getUser(req);
const status = await store.getStatus({ user });
res.send(status);
});
// Make sure this is the last "GET" handler
router.get('/:id', async (req, res) => {
const user = await getUser(req);
const opts: NotificationGetOptions = {
@@ -244,12 +251,6 @@ export async function createRouter(
res.send(notifications[0]);
});
router.get('/status', async (req, res) => {
const user = await getUser(req);
const status = await store.getStatus({ user });
res.send(status);
});
router.post('/update', async (req, res) => {
const user = await getUser(req);
const { ids, read, saved } = req.body;