feat: webhooks config on v1
This commit is contained in:
@@ -2,9 +2,9 @@ import { legacyDocumentConverter } from "../../src/controllers/v1/types";
|
||||
import { Logger } from "../../src/lib/logger";
|
||||
import { supabase_service } from "./supabase";
|
||||
|
||||
export const callWebhook = async (teamId: string, jobId: string, data: any, specified?: string, v1 = false) => {
|
||||
export const callWebhook = async (teamId: string, id: string, data: any, specified?: string, v1 = false) => {
|
||||
try {
|
||||
const selfHostedUrl = process.env.SELF_HOSTED_WEBHOOK_URL?.replace("{{JOB_ID}}", jobId);
|
||||
const selfHostedUrl = process.env.SELF_HOSTED_WEBHOOK_URL?.replace("{{JOB_ID}}", id);
|
||||
const useDbAuthentication = process.env.USE_DB_AUTHENTICATION === 'true';
|
||||
let webhookUrl = specified ?? selfHostedUrl;
|
||||
|
||||
@@ -50,7 +50,7 @@ export const callWebhook = async (teamId: string, jobId: string, data: any, spec
|
||||
},
|
||||
body: JSON.stringify({
|
||||
success: data.success,
|
||||
jobId: jobId,
|
||||
id: id,
|
||||
data: dataToSend,
|
||||
error: data.error || undefined,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user