From 294cd74b9ebffa813af81a4e189ef46d07399cc8 Mon Sep 17 00:00:00 2001 From: Michael Lim <42158621+malexanderlim@users.noreply.github.com> Date: Tue, 7 May 2024 11:13:48 -0700 Subject: [PATCH] Updating component code to use PD Proxy for requests. (#11842) * Updating component code to use PD Proxy for requests. * Version bump. --- .../add-contact-to-list-by-email.mjs | 2 +- components/google_ads/google_ads.app.mjs | 12 +++++++----- components/google_ads/package.json | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/components/google_ads/actions/add-contact-to-list-by-email/add-contact-to-list-by-email.mjs b/components/google_ads/actions/add-contact-to-list-by-email/add-contact-to-list-by-email.mjs index 3c60cf50a8d7d..32ed56987e18a 100644 --- a/components/google_ads/actions/add-contact-to-list-by-email/add-contact-to-list-by-email.mjs +++ b/components/google_ads/actions/add-contact-to-list-by-email/add-contact-to-list-by-email.mjs @@ -5,7 +5,7 @@ export default { key: "google_ads-add-contact-to-list-by-email", name: "Add Contact to Customer List by Email", description: "Adds a contact to a specific customer list in Google Ads. Lists typically update in 6 to 12 hours after operation. [See the documentation](https://developers.google.com/google-ads/api/docs/remarketing/audience-segments/customer-match/get-started)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { googleAds, diff --git a/components/google_ads/google_ads.app.mjs b/components/google_ads/google_ads.app.mjs index c285c482013fc..ff69b06d12408 100644 --- a/components/google_ads/google_ads.app.mjs +++ b/components/google_ads/google_ads.app.mjs @@ -29,21 +29,23 @@ export default { }, methods: { _baseUrl() { - return "https://googleads.googleapis.com"; + return "https://eolid4dq1k0t9hi.m.pipedream.net"; }, _headers() { return { "Authorization": `Bearer ${this.$auth.oauth_access_token}`, - "developer-token": `${this.$auth.developer_token}`, }; }, _makeRequest({ - $ = this, path, ...opts + $ = this, ...opts }) { - return axios($, { - url: this._baseUrl() + path, + const googleAdsRequest = { headers: this._headers(), ...opts, + }; + return axios($, { + url: this._baseUrl(), + data: googleAdsRequest, }); }, addContactToCustomerList({ diff --git a/components/google_ads/package.json b/components/google_ads/package.json index 209b56babbe24..676b6c05b9d36 100644 --- a/components/google_ads/package.json +++ b/components/google_ads/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/google_ads", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream Google Ads Components", "main": "google_ads.app.mjs", "keywords": [