Add standalone NotificationsView
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user