fix(plugin-stripe): properly types async webhooks (#7317)

This commit is contained in:
Jacob Fletcher
2024-07-23 14:30:09 -04:00
committed by GitHub
parent 863abc0e6b
commit a35979f74e
3 changed files with 1 additions and 5 deletions

View File

@@ -70,8 +70,6 @@ const typescriptRules = {
'@typescript-eslint/no-unsafe-argument': 'off', '@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/unbound-method': 'warn', '@typescript-eslint/unbound-method': 'warn',
// This rule doesn't work well in .tsx files
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/consistent-type-imports': 'warn', '@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/no-explicit-any': 'warn', '@typescript-eslint/no-explicit-any': 'warn',
// Type-aware any rules end // Type-aware any rules end

View File

@@ -8,7 +8,7 @@ export type StripeWebhookHandler<T = any> = (args: {
pluginConfig?: StripePluginConfig pluginConfig?: StripePluginConfig
req: PayloadRequest req: PayloadRequest
stripe: Stripe stripe: Stripe
}) => void }) => Promise<void> | void
export type StripeWebhookHandlers = { export type StripeWebhookHandlers = {
[webhookName: string]: StripeWebhookHandler [webhookName: string]: StripeWebhookHandler

View File

@@ -9,8 +9,6 @@ export const syncPriceJSON = async (args) => {
const { id: eventID, default_price } = event.data.object const { id: eventID, default_price } = event.data.object
console.log(event.data.object)
let payloadProductID let payloadProductID
// First lookup the product in Payload // First lookup the product in Payload