Skip to content

Commit

Permalink
fix ts issue
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminshafii committed Dec 4, 2024
1 parent 1f19d17 commit 7fb141e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/app/api/webhook/handler-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export function createWebhookHandler(
if (options.requiredMetadata) {
const metadata = event.data.object.metadata || {};
const missingFields = options.requiredMetadata.filter(
field => !metadata[field]
(field) => !metadata[field]
);

if (missingFields.length > 0) {
throw new Error(
`Missing required metadata fields: ${missingFields.join(", ")}`
Expand Down Expand Up @@ -53,4 +53,4 @@ export function createWebhookHandler(
};
}
};
}
}
1 change: 1 addition & 0 deletions web/app/api/webhook/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type WebhookEvent = {
type: string;
data: {
object: Stripe.Event.Data.Object & {
id: string;
metadata?: {
userId?: string;
type?: string;
Expand Down

0 comments on commit 7fb141e

Please sign in to comment.