budibase/packages/frontend-core/src/api/analytics.js

18 lines
442 B
JavaScript
Raw Normal View History

export const buildAnalyticsEndpoints = API => ({
/**
* Gets the current status of analytics for this environment
*/
getAnalyticsStatus: async () => {
return await API.get({
url: "/api/bbtel",
})
},
2022-08-10 12:01:54 +02:00
analyticsPing: async ({ source }) => {
2022-08-10 12:29:11 +02:00
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
2022-08-10 12:01:54 +02:00
return await API.post({
url: "/api/bbtel/ping",
2022-08-10 12:29:11 +02:00
body: { source, timezone },
2022-08-10 12:01:54 +02:00
})
},
})