Skip to content

Commit

Permalink
use the generic function to check brand help center enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
aubin-tchoi committed Jan 13, 2025
1 parent acc6c3f commit fc6a5a0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions connectors/src/connectors/zendesk/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
fetchZendeskTicketComments,
fetchZendeskTickets,
getZendeskBrandSubdomain,
isBrandHelpCenterEnabled,
} from "@connectors/connectors/zendesk/lib/zendesk_api";
import { ZENDESK_BATCH_SIZE } from "@connectors/connectors/zendesk/temporal/config";
import { dataSourceConfigFromConnector } from "@connectors/lib/api/data_source_config";
Expand Down Expand Up @@ -213,11 +214,7 @@ export async function getZendeskHelpCenterReadAllowedBrandIdsActivity(
if (!fetchedBrand) {
await brandInDb?.revokeTicketsPermissions();
await brandInDb?.revokeHelpCenterPermissions();
} else if (
// TODO(2025-01-10 aubin): replace this with the generic function isBrandHelpCenterEnabled
!fetchedBrand.has_help_center ||
fetchedBrand.help_center_state !== "enabled"
) {
} else if (!isBrandHelpCenterEnabled(fetchedBrand)) {
await brandInDb?.revokeHelpCenterPermissions();
}
}
Expand Down

0 comments on commit fc6a5a0

Please sign in to comment.