Skip to content

Commit

Permalink
enhance(webhook): add userId to payload
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Apr 3, 2022
1 parent f8e6f3c commit ec3be7e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/backend/src/queue/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export function webhookDeliver(webhook: Webhook, type: typeof webhookEventTypes[
type,
content,
webhookId: webhook.id,
userId: webhook.userId,
to: webhook.url,
secret: webhook.secret,
createdAt: Date.now(),
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/queue/processors/webhook-deliver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default async (job: Bull.Job<WebhookDeliverJobData>) => {
},
body: JSON.stringify({
hookId: job.data.webhookId,
userId: job.data.userId,
eventId: job.data.eventId,
createdAt: job.data.createdAt,
type: job.data.type,
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/queue/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export type WebhookDeliverJobData = {
type: string;
content: unknown;
webhookId: Webhook['id'];
userId: User['id'];
to: string;
secret: string;
createdAt: number;
Expand Down

0 comments on commit ec3be7e

Please sign in to comment.