Set workflow trigger to connected once the webhook is registered
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import type { WorkflowRun, WorkflowRunStep } from ".prisma/client";
|
||||
import type {
|
||||
CustomEventSchema,
|
||||
ErrorSchema,
|
||||
LogMessageSchema,
|
||||
WaitSchema,
|
||||
CustomEventSchema,
|
||||
} from "@trigger.dev/common-schemas";
|
||||
import type { z } from "zod";
|
||||
import { prisma } from "~/db.server";
|
||||
import { IngestEvent } from "~/services/events/ingest.server";
|
||||
import { Organization } from "./organization.server";
|
||||
import { User } from "./user.server";
|
||||
import { Workflow } from "./workflow.server";
|
||||
import type { Organization } from "./organization.server";
|
||||
import type { User } from "./user.server";
|
||||
import type { Workflow } from "./workflow.server";
|
||||
|
||||
type WorkflowRunStatus = WorkflowRun["status"];
|
||||
export type { WorkflowRun, WorkflowRunStep, WorkflowRunStatus };
|
||||
|
||||
@@ -46,6 +46,13 @@ export class RegisterWebhook {
|
||||
},
|
||||
});
|
||||
|
||||
await this.#prismaClient.workflowTrigger.update({
|
||||
where: { id: webhook.triggerId },
|
||||
data: {
|
||||
status: "CONNECTED",
|
||||
},
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Trigger } from "@trigger.dev/sdk";
|
||||
import { github } from "@trigger.dev/integrations";
|
||||
|
||||
const trigger = new Trigger({
|
||||
id: "github-webhook-5",
|
||||
id: "github-webhook-7",
|
||||
name: "GitHub Issue changes for jsonhero-web",
|
||||
apiKey: "trigger_dev_zC25mKNn6c0q",
|
||||
endpoint: "ws://localhost:8889/ws",
|
||||
|
||||
Reference in New Issue
Block a user