diff --git a/src/index.ts b/src/index.ts index a97c86d..1704da6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -143,12 +143,11 @@ export default async function (manager: Manager, settings: ComponentSettings) { events: [eventData], } - const amplitudeEndpoint = (settings: ComponentSettings): string => { - return settings.eu_data - ? 'https://api.eu.amplitude.com/2/httpapi' - : 'https://api2.amplitude.com/2/httpapi' - } - manager.fetch(`${amplitudeEndpoint(settings)}`, { + const endpoint = settings.eu_data + ? 'https://api.eu.amplitude.com/2/httpapi' + : 'https://api2.amplitude.com/2/httpapi' + + manager.fetch(endpoint, { method: 'POST', headers: { 'Content-Type': 'application/json',