Skip to content

Commit

Permalink
fix association query
Browse files Browse the repository at this point in the history
  • Loading branch information
hdiniz committed May 13, 2024
1 parent 45b4d67 commit c9191f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/paymentProviders/stripe/webhook.ts
Expand Up @@ -597,7 +597,7 @@ export const reviewOpened = async (event: Stripe.Event) => {
model: models.Collective,
as: 'collective',
foreignKey: 'CollectiveId',
include: [{ model: models.Collective, as: 'host', foreignKey: 'HostCollectiveId', required: true }],
include: [{ model: models.Collective, as: 'host', foreignKey: 'HostCollectiveId', required: false }],
},
{ model: models.Collective, as: 'fromCollective', foreignKey: 'FromCollectiveId' },
models.Tier,
Expand All @@ -623,7 +623,7 @@ export const reviewOpened = async (event: Stripe.Event) => {
order: order.info,
fromAccountInfo: order.data?.fromAccountInfo,
fromCollective: order.fromCollective.info,
host: order.collective.host.info,
host: order.collective.host?.info,
toCollective: order.collective.info,
tierName: order.Tier?.name,
reason: review.opened_reason,
Expand Down Expand Up @@ -681,7 +681,7 @@ export const reviewClosed = async (event: Stripe.Event) => {
model: models.Collective,
as: 'collective',
foreignKey: 'CollectiveId',
include: [{ model: models.Collective, as: 'host', foreignKey: 'HostCollectiveId', required: true }],
include: [{ model: models.Collective, as: 'host', foreignKey: 'HostCollectiveId', required: false }],
},
{ model: models.Collective, as: 'fromCollective', foreignKey: 'FromCollectiveId' },
models.Tier,
Expand Down

0 comments on commit c9191f2

Please sign in to comment.