added multiple event name support to the eventDispatcher

This commit is contained in:
Chigala
2023-07-26 21:18:03 +01:00
parent 51e6a74eda
commit 8ac83f1d59
3 changed files with 15 additions and 4 deletions
@@ -33,7 +33,9 @@ export class DeliverEventService {
const possibleEventDispatchers = await tx.eventDispatcher.findMany({
where: {
environmentId: eventRecord.environmentId,
event: eventRecord.name,
event: {
has: eventRecord.name,
},
source: eventRecord.source,
enabled: true,
manual: false,
@@ -0,0 +1,9 @@
/*
Warnings:
- The `event` column on the `EventDispatcher` table would be dropped and recreated. This will lead to data loss if there is data in the column.
*/
-- AlterTable
ALTER TABLE "EventDispatcher" DROP COLUMN "event",
ADD COLUMN "event" TEXT[];
+3 -3
View File
@@ -582,12 +582,12 @@ enum DynamicTriggerType {
}
model EventDispatcher {
id String @id @default(cuid())
event String
id String @id @default(cuid())
event String[]
source String
payloadFilter Json?
contextFilter Json?
manual Boolean @default(false)
manual Boolean @default(false)
dispatchableId String
dispatchable Json