Set workflow trigger to connected once the webhook is registered

This commit is contained in:
Eric Allam
2022-12-22 11:10:27 +00:00
parent 2f31c1422f
commit 8cf8228ba4
3 changed files with 12 additions and 5 deletions
+4 -4
View File
@@ -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;
}
+1 -1
View File
@@ -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",