fix: refetch contact after awaiting triggers
This commit is contained in:
@@ -71,6 +71,13 @@ export class ActionService {
|
||||
|
||||
const triggers = await ContactService.triggers(contact.id);
|
||||
|
||||
// Refetch the contact, as it may have subscribed now
|
||||
contact = await prisma.contact.findUniqueOrThrow({
|
||||
where: {
|
||||
id: contact.id,
|
||||
},
|
||||
});
|
||||
|
||||
for (const action of actions) {
|
||||
const hasTriggeredAction = !!triggers.find((t) => t.actionId === action.id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user