Add standalone NotificationsView

This commit is contained in:
Johannes Zellner
2026-01-22 18:55:50 +01:00
parent 03fe72e0b1
commit b6371a0bdf
4 changed files with 177 additions and 102 deletions
+9 -2
View File
@@ -6,10 +6,17 @@ function create() {
const accessToken = localStorage.token;
return {
async list(acknowledged = false) {
async list(acknowledged = null) {
const query = {
access_token: accessToken,
per_page: 1000
};
if (acknowledged !== null) query.acknowledged = !!acknowledged;
let result;
try {
result = await fetcher.get(`${API_ORIGIN}/api/v1/notifications`, { acknowledged, access_token: accessToken, per_page: 1000 });
result = await fetcher.get(`${API_ORIGIN}/api/v1/notifications`, query);
} catch (e) {
return [e];
}