Skip to content

Commit

Permalink
better handle endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-astra-via committed May 28, 2024
1 parent e7a80a5 commit 9705b55
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 9705b55

Please sign in to comment.