fix(Customer.io Node): Fix api endpoint when using EU region (#7485)

Fixes #7484
This commit is contained in:
Léo Martinez 2023-10-23 11:01:48 +02:00 committed by GitHub
parent 7b1973c058
commit 519680c2cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,13 @@ export async function customerIoApiRequest(
const region = credentials.region;
options.url = `https://${region}/api/v1${endpoint}`;
} else if (baseApi === 'api') {
options.url = `https://api.customer.io/v1/api${endpoint}`;
const region = credentials.region;
// Special handling for EU region
if (region === 'track-eu.customer.io') {
options.url = `https://api-eu.customer.io/v1/api${endpoint}`;
} else {
options.url = `https://api.customer.io/v1/api${endpoint}`;
}
} else if (baseApi === 'beta') {
options.url = `https://beta-api.customer.io/v1/api${endpoint}`;
}