forked from DebaucheryLibrarian/traxxx
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user