Skip to content

Commit

Permalink
Merge pull request #1224 from CruGlobal/hs-1252356-add-org-edit
Browse files Browse the repository at this point in the history
MPDX-8491 - Fix Activity Type Case-Sensitivity Issue in Google Calendar Integration
  • Loading branch information
dr-bizz authored Dec 13, 2024
2 parents 0c76edd + 49896c6 commit 2130952
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pages/api/graphql-rest.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -993,10 +993,22 @@ class MpdxRestApi extends RESTDataSource {
googleIntegrationId,
googleIntegration,
) {
const attributes = {};
interface GoogleIntegrationAttributes {
overwrite?: boolean;
calendar_id?: string;
calendar_integrations?: string[];
}
const attributes: GoogleIntegrationAttributes = {};
Object.keys(googleIntegration).map((key) => {
attributes[camelToSnake(key)] = googleIntegration[key];
});
if (attributes?.calendar_integrations) {
// Convert to lowercase since we convert them from lowercase to Uppercase
// when we fetch initially from pages/api/Schema/Settings/Integrations/Google/parse.ts
attributes.calendar_integrations = attributes?.calendar_integrations.map(
(integration) => integration.toLowerCase(),
);
}

const { data }: { data: GoogleIntegrationResponse } = await this.put(
`user/google_accounts/${googleAccountId}/google_integrations/${googleIntegrationId}`,
Expand Down

0 comments on commit 2130952

Please sign in to comment.