Added quick alert button to actor bio.

This commit is contained in:
2025-03-09 04:12:02 +01:00
parent 45a0631c9b
commit 61ed171c9d
6 changed files with 166 additions and 9 deletions

View File

@@ -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);
}