Added quick alert button to actor bio.
This commit is contained in:
@@ -418,6 +418,13 @@ const email = ref(false);
|
||||
const stashes = ref([]);
|
||||
|
||||
async function createAlert() {
|
||||
const alertLabel = [
|
||||
...actors.value.map((actor) => actor.name),
|
||||
...tags.value.map((tag) => tag.name),
|
||||
...entities.value.map((entity) => entity.name),
|
||||
...matches.value.map((match) => match.expression),
|
||||
].filter(Boolean).join(', ');
|
||||
|
||||
await post('/alerts', {
|
||||
all: fieldsAnd.value,
|
||||
allActors: actorAnd.value,
|
||||
@@ -430,7 +437,11 @@ async function createAlert() {
|
||||
notify: notify.value,
|
||||
email: email.value,
|
||||
stashes: stashes.value.map((stash) => stash.id),
|
||||
}, { appendErrorMessage: true });
|
||||
}, {
|
||||
successFeedback: `Alert for '${alertLabel}' set`,
|
||||
errorFeedback: `Failed to set alert for '${alertLabel}'`,
|
||||
appendErrorMessage: true,
|
||||
});
|
||||
|
||||
emit('close', true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user