List alerts in profile
This commit is contained in:
@@ -152,6 +152,32 @@ function curateStash(stash) {
|
||||
return curatedStash;
|
||||
}
|
||||
|
||||
function curateAlert(alert) {
|
||||
if (!alert) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const curatedAlert = alert;
|
||||
|
||||
if (alert.actors) {
|
||||
curatedAlert.actors = alert.actors.map(actor => curateActor(actor.actor || actor));
|
||||
}
|
||||
|
||||
if (alert.tags) {
|
||||
curatedAlert.tags = alert.tags.map(tag => curateTag(tag.tag || tag));
|
||||
}
|
||||
|
||||
if (alert.entity) {
|
||||
curatedAlert.entity = curateEntity(alert.entity.entity || alert.entity);
|
||||
}
|
||||
|
||||
if (alert.stashes) {
|
||||
curatedAlert.stashes = alert.stashes.map(stash => curateStash(stash.stash || stash));
|
||||
}
|
||||
|
||||
return curatedAlert;
|
||||
}
|
||||
|
||||
function curateUser(user) {
|
||||
if (!user) {
|
||||
return null;
|
||||
@@ -163,6 +189,10 @@ function curateUser(user) {
|
||||
curatedUser.stashes = user.stashes.map(stash => curateStash(stash.stash || stash));
|
||||
}
|
||||
|
||||
if (user.alerts) {
|
||||
curatedUser.alerts = user.alerts.map(alert => curateAlert(alert.alert || alert));
|
||||
}
|
||||
|
||||
return curatedUser;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,13 @@ function initUsersActions(store, _router) {
|
||||
id
|
||||
notify
|
||||
email
|
||||
stashes: alertsStashes {
|
||||
stash {
|
||||
id
|
||||
name
|
||||
slug
|
||||
}
|
||||
}
|
||||
tags: alertsTags {
|
||||
tag {
|
||||
id
|
||||
@@ -76,12 +83,16 @@ function initUsersActions(store, _router) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
type
|
||||
independent
|
||||
hasLogo
|
||||
parent {
|
||||
id
|
||||
name
|
||||
slug
|
||||
type
|
||||
independent
|
||||
hasLogo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user