Skip to content

Commit

Permalink
fix: Fix error handling in webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
DaevMithran committed Sep 10, 2024
1 parent be32b05 commit d61d9b8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/controllers/admin/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ export class WebhookController {

const customer = await CustomerService.instance.findbyPaymentProviderId(data.paymentProviderId);
if (customer) {
this.syncLogtoRoles(operation, customer.customerId, '');
await this.syncLogtoRoles(operation, customer.customerId, '');
}

await eventTracker.notify({
Expand Down Expand Up @@ -375,11 +375,9 @@ export class WebhookController {
switch (operation) {
case OperationNameEnum.SUBSCRIPTION_CREATE:
case OperationNameEnum.SUBSCRIPTION_UPDATE:
this.handleCustomerRoleAssignment(operation, logToHelper, user.logToId, productName);
return;
return await this.handleCustomerRoleAssignment(operation, logToHelper, user.logToId, productName);
case OperationNameEnum.SUBSCRIPTION_CANCEL:
this.handleCustomerRoleRemoval(operation, logToHelper, user.logToId);
return;
return await this.handleCustomerRoleRemoval(operation, logToHelper, user.logToId);
}
}

Expand Down

0 comments on commit d61d9b8

Please sign in to comment.